Documentation ¶
Index ¶
- Constants
- func CapEffCapEprm(pid int32) (uint64, uint64, error)
- func CgroupTaskPath(tgid, pid uint32) string
- func EnvVars(pid int32) (map[string]string, error)
- func GetFilledProcess(p *process.Process) *process.FilledProcess
- func GetProcesses() ([]*process.Process, error)
- func GetTagValue(tagName string, tags []string) string
- func Getpid() int32
- func NumCPU() (int, error)
- func PidTTY(pid int32) string
- func ProcExePath(pid int32) string
- func StatusPath(pid int32) string
- type ContainerID
- type ControlGroup
Constants ¶
const ContainerIDLen = sha256.Size * 2
ContainerIDLen is the length of a container ID is the length of the hex representation of a sha256 hash
Variables ¶
This section is empty.
Functions ¶
func CapEffCapEprm ¶
CapEffCapEprm returns the effective and permitted kernel capabilities of a process
func CgroupTaskPath ¶
CgroupTaskPath returns the path to the cgroup file of a pid in /proc
func GetFilledProcess ¶
func GetFilledProcess(p *process.Process) *process.FilledProcess
GetFilledProcess returns a FilledProcess from a Process input TODO: make a PR to export a similar function in Datadog/gopsutil. We only populate the fields we need for now.
func GetProcesses ¶
GetProcesses returns list of active processes
func GetTagValue ¶
GetTagValue returns the value of the given tag in the given list
func ProcExePath ¶
ProcExePath returns the path to the exe file of a pid in /proc
func StatusPath ¶
StatusPath returns the path to the status file of a pid in /proc
Types ¶
type ContainerID ¶
type ContainerID string
ContainerID is the type holding the container ID
func GetProcContainerID ¶
func GetProcContainerID(tgid, pid uint32) (ContainerID, error)
GetProcContainerID returns the container ID which the process belongs to. Returns "" if the process does not belong to a container.
func (ContainerID) Bytes ¶
func (c ContainerID) Bytes() []byte
Bytes returns the container ID as a byte array
type ControlGroup ¶
type ControlGroup struct { // ID unique hierarchy ID ID int // Controllers are the list of cgroup controllers bound to the hierarchy Controllers []string // Path is the pathname of the control group to which the process // belongs. It is relative to the mountpoint of the hierarchy. Path string }
ControlGroup describes the cgroup membership of a process
func GetProcControlGroups ¶
func GetProcControlGroups(tgid, pid uint32) ([]ControlGroup, error)
GetProcControlGroups returns the cgroup membership of the specified task.
func (ControlGroup) GetContainerID ¶
func (cg ControlGroup) GetContainerID() ContainerID
GetContainerID returns the container id extracted from the path of the control group