Apache Mesos
Classes | Namespaces | Enumerations | Functions | Variables
cgroups.hpp File Reference
#include <stdint.h>
#include <stdlib.h>
#include <set>
#include <string>
#include <vector>
#include <sys/types.h>
#include <process/future.hpp>
#include <process/timeout.hpp>
#include <stout/bytes.hpp>
#include <stout/duration.hpp>
#include <stout/hashmap.hpp>
#include <stout/nothing.hpp>
#include <stout/option.hpp>
#include <stout/try.hpp>

Go to the source code of this file.

Classes

class  cgroups::blkio::Device
 
struct  cgroups::blkio::Value
 
struct  cgroups::cpuacct::Stats
 
class  cgroups::memory::pressure::Counter
 
struct  cgroups::devices::Entry
 
struct  cgroups::devices::Entry::Selector
 
struct  cgroups::devices::Entry::Access
 
struct  std::hash< cgroups::memory::pressure::Level >
 

Namespaces

 cgroups
 
 cgroups::event
 
 cgroups::blkio
 
 cgroups::blkio::cfq
 
 cgroups::blkio::throttle
 
 cgroups::cpu
 
 cgroups::cpuacct
 
 cgroups::memory
 
 cgroups::memory::oom
 
 cgroups::memory::oom::killer
 
 cgroups::memory::pressure
 
 cgroups::devices
 
 cgroups::freezer
 
 cgroups::net_cls
 
 cgroups::named
 
 std
 

Enumerations

enum  cgroups::blkio::Operation {
  cgroups::blkio::Operation::TOTAL, cgroups::blkio::Operation::READ, cgroups::blkio::Operation::WRITE, cgroups::blkio::Operation::SYNC,
  cgroups::blkio::Operation::ASYNC, cgroups::blkio::Operation::DISCARD
}
 
enum  cgroups::memory::pressure::Level { cgroups::memory::pressure::LOW, cgroups::memory::pressure::MEDIUM, cgroups::memory::pressure::CRITICAL }
 

Functions

Try< std::string > cgroups::prepare (const std::string &baseHierarchy, const std::string &subsystem, const std::string &cgroup)
 
Try< Nothingcgroups::verify (const std::string &hierarchy, const std::string &cgroup="", const std::string &control="")
 
bool cgroups::enabled ()
 
Try< std::set< std::string > > cgroups::hierarchies ()
 
Result< std::string > cgroups::hierarchy (const std::string &subsystems)
 
Try< bool > cgroups::enabled (const std::string &subsystems)
 
Try< bool > cgroups::busy (const std::string &subsystems)
 
Try< std::set< std::string > > cgroups::subsystems ()
 
Try< std::set< std::string > > cgroups::subsystems (const std::string &hierarchy)
 
Try< Nothingcgroups::mount (const std::string &hierarchy, const std::string &subsystems, int retry=0)
 
Try< Nothingcgroups::unmount (const std::string &hierarchy)
 
Try< bool > cgroups::mounted (const std::string &hierarchy, const std::string &subsystems="")
 
Try< Nothingcgroups::create (const std::string &hierarchy, const std::string &cgroup, bool recursive=false)
 
bool cgroups::exists (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< std::string > > cgroups::get (const std::string &hierarchy, const std::string &cgroup="/")
 
Try< Nothingcgroups::kill (const std::string &hierarchy, const std::string &cgroup, int signal)
 
Try< std::string > cgroups::read (const std::string &hierarchy, const std::string &cgroup, const std::string &control)
 
Try< Nothingcgroups::write (const std::string &hierarchy, const std::string &cgroup, const std::string &control, const std::string &value)
 
bool cgroups::exists (const std::string &hierarchy, const std::string &cgroup, const std::string &control)
 
Try< std::set< pid_t > > cgroups::processes (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::set< pid_t > > cgroups::threads (const std::string &hierarchy, const std::string &cgroup)
 
Try< Nothingcgroups::assign (const std::string &hierarchy, const std::string &cgroup, pid_t pid)
 
Try< Nothingcgroups::isolate (const std::string &hierarchy, const std::string &cgroup, pid_t pid)
 
process::Future< uint64_t > cgroups::event::listen (const std::string &hierarchy, const std::string &cgroup, const std::string &control, const Option< std::string > &args=Option< std::string >::none())
 
process::Future< Nothingcgroups::destroy (const std::string &hierarchy, const std::string &cgroup="/")
 
process::Future< Nothingcgroups::destroy (const std::string &hierarchy, const std::string &cgroup, const Duration &timeout)
 
process::Future< bool > cgroups::cleanup (const std::string &hierarchy)
 
Try< hashmap< std::string, uint64_t > > cgroups::stat (const std::string &hierarchy, const std::string &cgroup, const std::string &file)
 
Result< std::string > cgroups::blkio::cgroup (pid_t pid)
 
Try< std::vector< Value > > cgroups::blkio::cfq::time (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::time_recursive (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::sectors (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::sectors_recursive (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::io_merged (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::io_merged_recursive (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::io_queued (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::io_queued_recursive (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::io_service_bytes (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::io_service_bytes_recursive (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::io_service_time (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::io_service_time_recursive (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::io_serviced (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::io_serviced_recursive (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::io_wait_time (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::cfq::io_wait_time_recursive (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::throttle::io_service_bytes (const std::string &hierarchy, const std::string &cgroup)
 
Try< std::vector< Value > > cgroups::blkio::throttle::io_serviced (const std::string &hierarchy, const std::string &cgroup)
 
std::ostream & cgroups::blkio::operator<< (std::ostream &stream, const Device &device)
 
std::ostream & cgroups::blkio::operator<< (std::ostream &stream, const Operation op)
 
std::ostream & cgroups::blkio::operator<< (std::ostream &stream, const Value &value)
 
Result< std::string > cgroups::cpu::cgroup (pid_t pid)
 
Try< Nothingcgroups::cpu::shares (const std::string &hierarchy, const std::string &cgroup, uint64_t shares)
 
Try< uint64_t > cgroups::cpu::shares (const std::string &hierarchy, const std::string &cgroup)
 
Try< Nothingcgroups::cpu::cfs_period_us (const std::string &hierarchy, const std::string &cgroup, const Duration &duration)
 
Try< Durationcgroups::cpu::cfs_quota_us (const std::string &hierarchy, const std::string &cgroup)
 
Try< Nothingcgroups::cpu::cfs_quota_us (const std::string &hierarchy, const std::string &cgroup, const Duration &duration)
 
Result< std::string > cgroups::cpuacct::cgroup (pid_t pid)
 
Try< Stats > cgroups::cpuacct::stat (const std::string &hierarchy, const std::string &cgroup)
 
Result< std::string > cgroups::memory::cgroup (pid_t pid)
 
Try< Bytescgroups::memory::limit_in_bytes (const std::string &hierarchy, const std::string &cgroup)
 
Try< Nothingcgroups::memory::limit_in_bytes (const std::string &hierarchy, const std::string &cgroup, const Bytes &limit)
 
Result< Bytescgroups::memory::memsw_limit_in_bytes (const std::string &hierarchy, const std::string &cgroup)
 
Try< bool > cgroups::memory::memsw_limit_in_bytes (const std::string &hierarchy, const std::string &cgroup, const Bytes &limit)
 
Try< Bytescgroups::memory::soft_limit_in_bytes (const std::string &hierarchy, const std::string &cgroup)
 
Try< Nothingcgroups::memory::soft_limit_in_bytes (const std::string &hierarchy, const std::string &cgroup, const Bytes &limit)
 
Try< Bytescgroups::memory::usage_in_bytes (const std::string &hierarchy, const std::string &cgroup)
 
Try< Bytescgroups::memory::memsw_usage_in_bytes (const std::string &hierarchy, const std::string &cgroup)
 
Try< Bytescgroups::memory::max_usage_in_bytes (const std::string &hierarchy, const std::string &cgroup)
 
process::Future< Nothingcgroups::memory::oom::listen (const std::string &hierarchy, const std::string &cgroup)
 
Try< bool > cgroups::memory::oom::killer::enabled (const std::string &hierarchy, const std::string &cgroup)
 
Try< Nothingcgroups::memory::oom::killer::enable (const std::string &hierarchy, const std::string &cgroup)
 
Try< Nothingcgroups::memory::oom::killer::disable (const std::string &hierarchy, const std::string &cgroup)
 
std::ostream & cgroups::memory::pressure::operator<< (std::ostream &stream, Level level)
 
std::ostream & cgroups::devices::operator<< (std::ostream &stream, const Entry::Selector::Type &type)
 
std::ostream & cgroups::devices::operator<< (std::ostream &stream, const Entry::Selector &selector)
 
std::ostream & cgroups::devices::operator<< (std::ostream &stream, const Entry::Access &access)
 
std::ostream & cgroups::devices::operator<< (std::ostream &stream, const Entry &entry)
 
bool cgroups::devices::operator== (const Entry::Selector &left, const Entry::Selector &right)
 
bool cgroups::devices::operator== (const Entry::Access &left, const Entry::Access &right)
 
bool cgroups::devices::operator== (const Entry &left, const Entry &right)
 
Try< std::vector< Entry > > cgroups::devices::list (const std::string &hierarchy, const std::string &cgroup)
 
Try< Nothingcgroups::devices::allow (const std::string &hierarchy, const std::string &cgroup, const Entry &entry)
 
Try< Nothingcgroups::devices::deny (const std::string &hierarchy, const std::string &cgroup, const Entry &entry)
 
process::Future< Nothingcgroups::freezer::freeze (const std::string &hierarchy, const std::string &cgroup)
 
process::Future< Nothingcgroups::freezer::thaw (const std::string &hierarchy, const std::string &cgroup)
 
Try< uint32_t > cgroups::net_cls::classid (const std::string &hierarchy, const std::string &cgroup)
 
Try< Nothingcgroups::net_cls::classid (const std::string &hierarchy, const std::string &cgroup, const uint32_t handle)
 
Result< std::string > cgroups::named::cgroup (const std::string &hierarchyName, pid_t pid)
 

Variables

const Duration cgroups::FREEZE_RETRY_INTERVAL = Seconds(10)
 
const unsigned int cgroups::THREAD_ASSIGN_RETRIES = 100