Documentation ¶
Index ¶
- Constants
- Variables
- func Check() error
- func Fix() error
- func NestedGroupPath(suffix string) (string, error)
- func PidGroupPath(pid int) (string, error)
- func VerifyGroupPath(g string) error
- type BFQ
- type CGMode
- type CPU
- type CPUMax
- type ControllerToggle
- type Entry
- type Event
- type HugeTlb
- type HugeTlbEntry
- type IO
- type IOType
- type Manager
- func (c *Manager) AddProc(pid int) error
- func (c *Manager) AddThread(tid uint64) error
- func (c *Manager) Controllers() ([]string, error)
- func (c *Manager) Delete() error
- func (c *Manager) EventChan() (<-chan Event, <-chan error)
- func (c *Manager) Freeze() error
- func (c *Manager) MemoryEventFD() (int, uint32, error)
- func (c *Manager) MoveTo(destination *Manager) error
- func (c *Manager) NewChild(name string, resources *Resources) (*Manager, error)
- func (c *Manager) Procs(recursive bool) ([]int, error)
- func (c *Manager) RootControllers() ([]string, error)
- func (c *Manager) Thaw() error
- func (c *Manager) ToggleControllers(controllers []string, t ControllerToggle) error
- func (c *Manager) Update(resources *Resources) error
- type Memory
- type Mount
- type Pids
- type Resources
- type State
- type Value
Constants ¶
const (
DefaultCgroupPath = "/sys/fs/cgroup"
)
Variables ¶
var ( ErrInvalidFormat = errors.New("cgroups: parsing file with invalid format failed") ErrInvalidGroupPath = errors.New("cgroups: invalid group path") )
Functions ¶
func NestedGroupPath ¶
NestedGroupPath will nest the cgroups based on the calling processes cgroup placing its child processes inside its own path
func PidGroupPath ¶
PidGroupPath will return the correct cgroup paths for an existing process running inside a cgroup This is commonly used for the Load function to restore an existing container
func VerifyGroupPath ¶
VerifyGroupPath verifies the format of group path string g. The format is same as the third field in /proc/PID/cgroup. e.g. "/user.slice/user-1001.slice/session-1.scope"
g must be a "clean" absolute path starts with "/", and must not contain "/sys/fs/cgroup" prefix.
VerifyGroupPath doesn't verify whether g actually exists on the system.
Types ¶
type ControllerToggle ¶
type ControllerToggle int
const ( Enable ControllerToggle = iota + 1 Disable )
type HugeTlb ¶
type HugeTlb []HugeTlbEntry
type HugeTlbEntry ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) Controllers ¶
func (*Manager) MemoryEventFD ¶
MemoryEventFD returns inotify file descriptor and 'memory.events' inotify watch descriptor
func (*Manager) RootControllers ¶
func (*Manager) ToggleControllers ¶
func (c *Manager) ToggleControllers(controllers []string, t ControllerToggle) error
type Mount ¶
type Mount struct { Device string MountPoint string FileSystemType string Flags string Bsize int64 Blocks uint64 Total uint64 Used uint64 Avail uint64 PCT uint8 }
Mount is a structure used to contain mount point data
type Resources ¶
Resources for a cgroups v2 unified hierarchy
func (*Resources) EnabledControllers ¶
EnabledControllers returns the list of all not nil resource controllers