Documentation
¶
Index ¶
- Constants
- func GetAllBinaryProcs() (map[string][]uint32, error)
- func GetMountNSFirstProcesses() (map[int]int, error)
- func GetProcBinary(pid uint) (string, error)
- func GetProcNS(pid uint, nsName string) (int, error)
- func GetProcessStartTime(pid uint) (int, error)
- type ProcNS
- type ProcStat
- type ProcStatus
Constants ¶
const (
StatNumFields = 52
)
Variables ¶
This section is empty.
Functions ¶
func GetAllBinaryProcs ¶ added in v0.11.0
GetProcNS returns the namespace ID of a given namespace and process. To do so, it requires access to the /proc file system of the host, and CAP_SYS_PTRACE capability.
func GetMountNSFirstProcesses ¶
GetMountNSFirstProcesses return mapping between mount NS to its first process (aka, the process with the oldest start time in the mount NS)
func GetProcBinary ¶ added in v0.11.0
GetProcNS returns the namespace ID of a given namespace and process. To do so, it requires access to the /proc file system of the host, and CAP_SYS_PTRACE capability.
func GetProcNS ¶
GetProcNS returns the namespace ID of a given namespace and process. To do so, it requires access to the /proc file system of the host, and CAP_SYS_PTRACE capability.
func GetProcessStartTime ¶
GetProcessStartTime return the start time of the process using the procfs
Types ¶
type ProcNS ¶
type ProcNS struct {
Cgroup int
Ipc int
Mnt int
Net int
Pid int
PidForChildren int
Time int
TimeForChildren int
User int
Uts int
}
func GetAllProcNS ¶ added in v0.11.0
GetAllProcNS return all the namespaces of a given process. To do so, it requires access to the /proc file system of the host, and CAP_SYS_PTRACE capability.
type ProcStat ¶ added in v0.18.0
type ProcStat struct {
// contains filtered or unexported fields
}
ProcStat represents the minimal required fields of the /proc stat file.
func NewProcStat ¶ added in v0.18.0
NewProcStat reads the /proc/<pid>/stat file and parses it into a ProcStat struct.
func NewThreadProcStat ¶ added in v0.18.0
NewThreadProcStat reads the /proc/<pid>/task/<tid>/stat file and parses it into a ProcStat struct.
func (*ProcStat) GetStartTime ¶ added in v0.23.0
GetStartTime returns the time the process started after system boot (in clock ticks).
type ProcStatus ¶ added in v0.18.0
type ProcStatus struct {
// contains filtered or unexported fields
}
ProcStatus represents the minimal required fields of the /proc status file.
func NewProcStatus ¶ added in v0.18.0
func NewProcStatus(pid int) (*ProcStatus, error)
NewProcStatus reads the /proc/<pid>/status file and parses it into a ProcStatus struct.
func NewThreadProcStatus ¶ added in v0.18.0
func NewThreadProcStatus(pid, tid int) (*ProcStatus, error)
NewThreadProcStatus reads the /proc/<pid>/task/<tid>/status file and parses it into a ProcStatus struct.
func (*ProcStatus) GetName ¶ added in v0.18.0
func (s *ProcStatus) GetName() string
GetName returns the name of the process.
func (*ProcStatus) GetNsPPid ¶ added in v0.18.0
func (s *ProcStatus) GetNsPPid() int
GetNsPPid returns process group ID in the namespace of the process.
func (*ProcStatus) GetNsPid ¶ added in v0.18.0
func (s *ProcStatus) GetNsPid() int
GetNsPid returns process ID in the namespace of the process.
func (*ProcStatus) GetNsTgid ¶ added in v0.18.0
func (s *ProcStatus) GetNsTgid() int
GetNsTgid returns thread group ID in the namespace of the process.
func (*ProcStatus) GetPPid ¶ added in v0.18.0
func (s *ProcStatus) GetPPid() int
GetPPid returns the parent process ID.
func (*ProcStatus) GetPid ¶ added in v0.18.0
func (s *ProcStatus) GetPid() int
GetPid returns the process ID.
func (*ProcStatus) GetTgid ¶ added in v0.18.0
func (s *ProcStatus) GetTgid() int
GetTgid returns the thread group ID.