Documentation ¶
Overview ¶
borrowed from tracee
borrowed from tracee
Index ¶
- Constants
- func CouldNotFindOrMountDefaultCgroup(ver CgroupVersion) error
- func CouldNotOpenFile(file string, err error) error
- func ErrorParsingFile(file string, err error) error
- func GetCgroupControllerHierarchy(subsys string) (int, error)
- func GetCgroupPath(rootDir string, cgroupId uint64, subPath string) (string, time.Time, error)
- func IsCgroupV2MountedAndDefault() (bool, error)
- func NoCgroupSupport() error
- type Cgroup
- type CgroupInfo
- type CgroupV1
- type CgroupV2
- type CgroupVersion
- type Cgroups
- type CgroupsController
- type CgroupsControllerImpl
- func (e *CgroupsControllerImpl) AddCgroupPath(cgroupPath string) (cgroupID uint64, containerID string, ok bool)
- func (e *CgroupsControllerImpl) Close() error
- func (e *CgroupsControllerImpl) DelCgroupID(cgroup uint64)
- func (e *CgroupsControllerImpl) EbpfCapturePossible() bool
- func (e *CgroupsControllerImpl) GetCgroupV2MountPoint() string
- func (e *CgroupsControllerImpl) GetCgroupsV2(containerID string) (info []CgroupInfo)
- func (e *CgroupsControllerImpl) GetContainerID(cgroup uint64) string
- func (e *CgroupsControllerImpl) GetExistingCgroupsByCgroupPath(cgroupPath string) (info []CgroupInfo)
- func (e *CgroupsControllerImpl) PopulateSocketsInodes(isCgroupV2 bool, inodeMap *ebpf.Map) error
- type RuntimeId
- type VersionNotSupported
Constants ¶
View Source
const ( CgroupV1FsType = "cgroup" CgroupV2FsType = "cgroup2" CgroupDefaultController = "cpuset" CgroupControllersFile = "/sys/fs/cgroup/cgroup.controllers" )
Variables ¶
This section is empty.
Functions ¶
func CouldNotFindOrMountDefaultCgroup ¶
func CouldNotFindOrMountDefaultCgroup(ver CgroupVersion) error
func CouldNotOpenFile ¶
func ErrorParsingFile ¶
func GetCgroupControllerHierarchy ¶
Returns a cgroup controller hierarchy value
func GetCgroupPath ¶
GetCgroupPath walks the cgroup fs and provides the cgroup directory path of given cgroupId and subPath (related to cgroup fs root dir). If subPath is empty, then all directories from cgroup fs will be searched for the given cgroupId.
Returns found cgroup path, its ctime, and an error if relevant
func IsCgroupV2MountedAndDefault ¶
IsCgroupV2MountedAndDefault tests if cgroup2 is mounted and is the default cgroup version being used by the running environment. It does so by checking the existence of a "cgroup.controllers" file in default cgroupfs mountpoint.
func NoCgroupSupport ¶
func NoCgroupSupport() error
Types ¶
type Cgroup ¶
type Cgroup interface { Destroy() error GetMountPoint() string GetVersion() CgroupVersion // contains filtered or unexported methods }
func NewCgroup ¶
func NewCgroup(ver CgroupVersion) (Cgroup, error)
type CgroupInfo ¶
type CgroupV1 ¶
type CgroupV1 struct {
// contains filtered or unexported fields
}
func (*CgroupV1) GetMountPoint ¶
func (*CgroupV1) GetVersion ¶
func (c *CgroupV1) GetVersion() CgroupVersion
type CgroupV2 ¶
type CgroupV2 struct {
// contains filtered or unexported fields
}
func (*CgroupV2) GetMountPoint ¶
func (*CgroupV2) GetVersion ¶
func (c *CgroupV2) GetVersion() CgroupVersion
type CgroupVersion ¶
type CgroupVersion int
const ( CgroupVersion1 CgroupVersion = iota CgroupVersion2 )
func GetCgroupDefaultVersion ¶
func GetCgroupDefaultVersion() (CgroupVersion, error)
func (CgroupVersion) String ¶
func (v CgroupVersion) String() string
type Cgroups ¶
type Cgroups struct {
// contains filtered or unexported fields
}
func NewCgroups ¶
func (*Cgroups) GetCgroup ¶
func (cs *Cgroups) GetCgroup(ver CgroupVersion) Cgroup
func (*Cgroups) GetDefaultCgroup ¶
func (*Cgroups) GetDefaultCgroupHierarchyID ¶
type CgroupsController ¶
type CgroupsController interface { EbpfCapturePossible() bool AddCgroupPath(cgroupPath string) (cgroupID uint64, containerID string, ok bool) PopulateSocketsInodes(isCgroupV2 bool, inodeMap *ebpf.Map) error DelCgroupID(cgroupID uint64) GetContainerID(cgroupID uint64) (containerID string) GetCgroupsV2(containerId string) []CgroupInfo GetExistingCgroupsByCgroupPath(cgroupPath string) []CgroupInfo GetCgroupV2MountPoint() string Close() error }
func NewCgroupsController ¶
func NewCgroupsController(procfs string) CgroupsController
type CgroupsControllerImpl ¶
type CgroupsControllerImpl struct {
// contains filtered or unexported fields
}
func (*CgroupsControllerImpl) AddCgroupPath ¶
func (e *CgroupsControllerImpl) AddCgroupPath(cgroupPath string) (cgroupID uint64, containerID string, ok bool)
func (*CgroupsControllerImpl) Close ¶
func (e *CgroupsControllerImpl) Close() error
func (*CgroupsControllerImpl) DelCgroupID ¶
func (e *CgroupsControllerImpl) DelCgroupID(cgroup uint64)
func (*CgroupsControllerImpl) EbpfCapturePossible ¶
func (e *CgroupsControllerImpl) EbpfCapturePossible() bool
func (*CgroupsControllerImpl) GetCgroupV2MountPoint ¶
func (e *CgroupsControllerImpl) GetCgroupV2MountPoint() string
func (*CgroupsControllerImpl) GetCgroupsV2 ¶
func (e *CgroupsControllerImpl) GetCgroupsV2(containerID string) (info []CgroupInfo)
func (*CgroupsControllerImpl) GetContainerID ¶
func (e *CgroupsControllerImpl) GetContainerID(cgroup uint64) string
func (*CgroupsControllerImpl) GetExistingCgroupsByCgroupPath ¶
func (e *CgroupsControllerImpl) GetExistingCgroupsByCgroupPath(cgroupPath string) (info []CgroupInfo)
func (*CgroupsControllerImpl) PopulateSocketsInodes ¶
func (e *CgroupsControllerImpl) PopulateSocketsInodes(isCgroupV2 bool, inodeMap *ebpf.Map) error
type RuntimeId ¶
type RuntimeId int
type VersionNotSupported ¶
type VersionNotSupported struct{}
func (*VersionNotSupported) Error ¶
func (c *VersionNotSupported) Error() string
Click to show internal directories.
Click to hide internal directories.