...

Package cgroups

import "github.com/chaos-mesh/chaos-mesh/pkg/chaosdaemon/cgroups"
Overview
Index

Overview ▾

func PidPath

func PidPath(pid int) cgroups.Path

func V1

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

func V2PidGroupPath

func V2PidGroupPath(pid int) (string, error)

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
}