Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
throttle_write_iops_device = TypedFile("blkio.throttle.write_iops_device ", contenttype=DeviceThrottle, many=True)
# time =
# time_recursive =
weight = IntegerFile("blkio.weight")
# weight_device =
class NetClsController(Controller):
"""
net_cls.classid
"""
class_id = IntegerFile("net_cls.classid")
class NetPrioController(Controller):
"""
net_prio.prioidx
net_prio.ifpriomap
"""
prioidx = IntegerFile("net_prio.prioidx", readonly=True)
ifpriomap = DictFile("netprio.ifpriomap")
cpu.cfs_period_us
cpu.cfs_quota_us
cpu.rt_period_us
cpu.rt_runtime_us
cpu.shares
cpu.stat
"""
cfs_period_us = IntegerFile("cpu.cfs_period_us")
cfs_quota_us = IntegerFile("cpu.cfs_quota_us")
rt_period_us = IntegerFile("cpu.rt_period_us")
rt_runtime_us = IntegerFile("cpu.rt_runtime_us")
shares = IntegerFile("cpu.shares")
stat = DictFile("cpu.stat", readonly=True)
class CpuAcctController(Controller):
"""
cpuacct.stat
cpuacct.usage
cpuacct.usage_percpu
"""
acct_stat = DictFile("cpuacct.stat", readonly=True)
usage = IntegerFile("cpuacct.usage")
usage_percpu = IntegerListFile("cpuacct.usage_percpu", readonly=True)
class CpuSetController(Controller):
"""
CpuSet cGroup controller. Provides access to
stat = DictFile("cpu.stat", readonly=True)
class CpuAcctController(Controller):
"""
cpuacct.stat
cpuacct.usage
cpuacct.usage_percpu
"""
acct_stat = DictFile("cpuacct.stat", readonly=True)
usage = IntegerFile("cpuacct.usage")
usage_percpu = IntegerListFile("cpuacct.usage_percpu", readonly=True)
class CpuSetController(Controller):
"""
CpuSet cGroup controller. Provides access to
cpuset.cpu_exclusive
cpuset.cpus
cpuset.mem_exclusive
cpuset.mem_hardwall
cpuset.memory_migrate
cpuset.memory_pressure
cpuset.memory_pressure_enabled
cpuset.memory_spread_page
cpuset.memory_spread_slab
cpuset.mems
cpuset.sched_load_balance
cpuset.sched_relax_domain_level
stat = DictFile("memory.stat", readonly=True)
use_hierarchy = FlagFile("memory.use_hierarchy")
force_empty = FlagFile("memory.force_empty")
oom_control = FlagFile("memory.oom_control")
move_charge_at_immigrate = BitFieldFile("memory.move_charge_at_immigrate")
# Requires special file interface
# numa_stat =
# Requires eventfd handling - https://www.kernel.org/doc/Documentation/cgroups/memory.txt
# pressure_level =
class DevicesController(Controller):
"""
devices.allow
devices.deny
devices.list
"""
allow = TypedFile("devices.allow", DeviceAccess, writeonly=True)
deny = TypedFile("devices.deny", DeviceAccess, writeonly=True)
list = TypedFile("devices.list", DeviceAccess, readonly=True, many=True)
class BlkIOController(Controller):
"""
blkio.io_merged
blkio.io_merged_recursive
blkio.io_queued
# pressure_level =
class DevicesController(Controller):
"""
devices.allow
devices.deny
devices.list
"""
allow = TypedFile("devices.allow", DeviceAccess, writeonly=True)
deny = TypedFile("devices.deny", DeviceAccess, writeonly=True)
list = TypedFile("devices.list", DeviceAccess, readonly=True, many=True)
class BlkIOController(Controller):
"""
blkio.io_merged
blkio.io_merged_recursive
blkio.io_queued
blkio.io_queued_recursive
blkio.io_service_bytes
blkio.io_service_bytes_recursive
blkio.io_serviced
blkio.io_serviced_recursive
blkio.io_service_time
blkio.io_service_time_recursive
blkio.io_wait_time
blkio.io_wait_time_recursive
blkio.leaf_weight
blkio.leaf_weight_device
blkio.reset_stats
return os.path.join(self.node.full_path, filename)
def get_property(self, filename):
"""Opens the file and reads the value"""
with open(self.filepath(filename)) as f:
return f.read().strip()
def set_property(self, filename, value):
"""Opens the file and writes the value"""
with open(self.filepath(filename), "w") as f:
return f.write(str(value))
class CpuController(Controller):
"""
Cpu cGroup controller. Provides access to
cpu.cfs_period_us
cpu.cfs_quota_us
cpu.rt_period_us
cpu.rt_runtime_us
cpu.shares
cpu.stat
"""
cfs_period_us = IntegerFile("cpu.cfs_period_us")
cfs_quota_us = IntegerFile("cpu.cfs_quota_us")
rt_period_us = IntegerFile("cpu.rt_period_us")
rt_runtime_us = IntegerFile("cpu.rt_runtime_us")
shares = IntegerFile("cpu.shares")
reset_stats = IntegerFile("blkio.reset_stats")
# sectors =
# sectors_recursive =
# throttle_io_service_bytes =
# throttle_io_serviced =
throttle_read_bps_device = TypedFile("blkio.throttle.read_bps_device", contenttype=DeviceThrottle, many=True)
throttle_read_iops_device = TypedFile("blkio.throttle.read_iops_device", contenttype=DeviceThrottle, many=True)
throttle_write_bps_device = TypedFile("blkio.throttle.write_bps_device ", contenttype=DeviceThrottle, many=True)
throttle_write_iops_device = TypedFile("blkio.throttle.write_iops_device ", contenttype=DeviceThrottle, many=True)
# time =
# time_recursive =
weight = IntegerFile("blkio.weight")
# weight_device =
class NetClsController(Controller):
"""
net_cls.classid
"""
class_id = IntegerFile("net_cls.classid")
class NetPrioController(Controller):
"""
net_prio.prioidx
net_prio.ifpriomap
"""
prioidx = IntegerFile("net_prio.prioidx", readonly=True)
ifpriomap = DictFile("netprio.ifpriomap")
mems = CommaDashSetFile("cpuset.mems")
cpu_exclusive = FlagFile("cpuset.cpu_exclusive")
mem_exclusive = FlagFile("cpuset.mem_exclusive")
mem_hardwall = FlagFile("cpuset.mem_hardwall")
memory_migrate = FlagFile("cpuset.memory_migrate")
memory_pressure = FlagFile("cpuset.memory_pressure")
memory_pressure_enabled = FlagFile("cpuset.memory_pressure_enabled")
memory_spread_page = FlagFile("cpuset.memory_spread_page")
memory_spread_slab = FlagFile("cpuset.memory_spread_slab")
sched_load_balance = FlagFile("cpuset.sched_load_balance")
sched_relax_domain_level = IntegerFile("cpuset.sched_relax_domain_level")
class MemoryController(Controller):
"""
Memory cGroup controller. Provides access to
memory.failcnt
memory.force_empty
memory.limit_in_bytes
memory.max_usage_in_bytes
memory.memsw.failcnt
memory.memsw.limit_in_bytes
memory.memsw.max_usage_in_bytes
memory.memsw.usage_in_bytes
memory.move_charge_at_immigrate
memory.numa_stat
memory.oom_control
memory.pressure_level