cgroups

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PidPath

func PidPath(pid int) cgroups.Path

func V1

func V1() ([]cgroups.Subsystem, error)

func V2PidGroupPath

func V2PidGroupPath(pid int) (string, error)

Types

type AttachCGroup

type AttachCGroup interface {
	TargetCGroup() CGroupInfo
	AttachProcess(pid int) error
}

func GetAttacherForPID

func GetAttacherForPID(targetPID int) (AttachCGroup, error)

GetAttacherForPID return a AttachCGroup, which could attach a process to the same cgroup of the target pid

type AttachCGroupV1

type AttachCGroupV1 struct {
	// contains filtered or unexported fields
}

func (*AttachCGroupV1) AttachProcess

func (a *AttachCGroupV1) AttachProcess(pid int) error

func (*AttachCGroupV1) TargetCGroup

func (a *AttachCGroupV1) TargetCGroup() CGroupInfo

type AttachCGroupV2

type AttachCGroupV2 struct {
	// contains filtered or unexported fields
}

func (*AttachCGroupV2) AttachProcess

func (a *AttachCGroupV2) AttachProcess(pid int) error

func (*AttachCGroupV2) TargetCGroup

func (a *AttachCGroupV2) TargetCGroup() CGroupInfo

type CGroupInfo

type CGroupInfo struct {
	CGMode       cgroups.CGMode
	V1Path       cgroups.Path
	V2CGroupPath string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL