Documentation ¶
Index ¶
- 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
- func (ps ProcStatus) GetGid() [4]int
- func (ps ProcStatus) GetName() string
- func (ps ProcStatus) GetNsPPid() int
- func (ps ProcStatus) GetNsPid() int
- func (ps ProcStatus) GetNsTgid() int
- func (ps ProcStatus) GetPPid() int
- func (ps ProcStatus) GetPid() int
- func (ps ProcStatus) GetState() string
- func (ps ProcStatus) GetTgid() int
- func (ps ProcStatus) GetThreads() int
- func (ps ProcStatus) GetUid() [4]int
Constants ¶
This section is empty.
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 { Pid int // process id Comm string // the filename of the executable State byte // process state Ppid int // parent process id Pgrp int // process group id Session int // session id TtyNr int // controlling terminal Tpgid int // foreground process group id of the controlling terminal Flags uint // process flags MinFlt uint64 // number of minor faults CminFlt uint64 // number of minor faults (all childs) MajFlt uint64 // number of major faults CmajFlt uint64 // number of major faults (all childs) Utime int64 // user mode jiffies (clock ticks) Stime int64 // kernel mode jiffies (clock ticks) Cutime int64 // user mode jiffies (all childs) Cstime int64 // kernel mode jiffies (all childs) Priority int // process priority Nice int // process nice value NumThreads int // number of threads in this process ItRealValue int64 // (obsolete, always 0) StartTime int64 // time the process started after system boot (in clock ticks) Vsize int64 // virtual memory size Rss int64 // resident set memory size Rsslim uint64 // current limit in bytes on the rss Startcode int64 // address above which program text can run Endcode int64 // address below which program text can run StartStack int64 // address of the start of the main process stack Kstkesp int64 // current value of stack pointer Kstkeip int64 // current value of instruction pointer Signal uint64 // bitmap of pending signals Blocked uint64 // bitmap of blocked signals SigIgnore uint64 // bitmap of ignored signals Sigcatch uint64 // bitmap of catched signals Wchan int64 // address of the syscall where process is in sleep mode Nswap int64 // number of swapped pages Cnswap int64 // cumulative nswap for child processes ExitSignal int // signal to be sent to parent when we die Processor int // current CPU RtPriority int // realtime priority Policy int // scheduling policy DelayacctBlkioTicks int64 // time spent waiting for block IO GuestTime int64 // guest time of the process CguestTime int64 // guest time of the process's children StartData int64 // address above which program data+bss is placed EndData int64 // address below which program data+bss is placed StartBrk int64 // address above which program heap can be expanded with brk() ArgStart int64 // address above which program command line is placed ArgEnd int64 // address below which program command line is placed EnvStart int64 // address above which program environment is placed EnvEnd int64 // address below which program environment is placed ExitCode int // the thread's exit_code in the form reported by the waitpid system call }
func NewProcStat ¶ added in v0.18.0
func NewThreadProcStat ¶ added in v0.18.0
type ProcStatus ¶ added in v0.18.0
func NewProcStatus ¶ added in v0.18.0
func NewProcStatus(pid int) (*ProcStatus, error)
func NewThreadProcStatus ¶ added in v0.18.0
func NewThreadProcStatus(pid, tid int) (*ProcStatus, error)
func (ProcStatus) GetGid ¶ added in v0.18.0
func (ps ProcStatus) GetGid() [4]int
GetGid returns GID in the following order: real, effective, saved set, filesystem.
func (ProcStatus) GetName ¶ added in v0.18.0
func (ps ProcStatus) GetName() string
GetName returns name of the process.
func (ProcStatus) GetNsPPid ¶ added in v0.18.0
func (ps ProcStatus) GetNsPPid() int
GetNsPPid returns parent process ID in the namespace of the process.
func (ProcStatus) GetNsPid ¶ added in v0.18.0
func (ps ProcStatus) GetNsPid() int
GetNsPid returns process ID in the namespace of the process.
func (ProcStatus) GetNsTgid ¶ added in v0.18.0
func (ps ProcStatus) GetNsTgid() int
GetNsTgid returns thread group ID in the namespace of the process.
func (ProcStatus) GetPPid ¶ added in v0.18.0
func (ps ProcStatus) GetPPid() int
GetPPid returns parent process ID.
func (ProcStatus) GetPid ¶ added in v0.18.0
func (ps ProcStatus) GetPid() int
GetPid returns process ID.
func (ProcStatus) GetState ¶ added in v0.18.0
func (ps ProcStatus) GetState() string
GetState returns state of the process.
func (ProcStatus) GetTgid ¶ added in v0.18.0
func (ps ProcStatus) GetTgid() int
GetTgid returns thread group ID.
func (ProcStatus) GetThreads ¶ added in v0.18.0
func (ps ProcStatus) GetThreads() int
GetThreads returns number of threads in process.
func (ProcStatus) GetUid ¶ added in v0.18.0
func (ps ProcStatus) GetUid() [4]int
GetUid returns UID in the following order: real, effective, saved set, filesystem.