Documentation ¶
Index ¶
- Constants
- Variables
- func HostPath(p string) string
- func LoadSymbolAddresses(symbols map[string]uint64) error
- type NamespaceID
- type NamespaceType
- type PID
- type Proc
- func (p *Proc) FindCGroupPathForPID(pid PID) (string, error)
- func (p *Proc) GetCurrentPIDNSID() (NamespaceID, error)
- func (p *Proc) GetNSForPID(pid PID, ns NamespaceType) (NamespaceID, error)
- func (p *Proc) GetProcessStartTime(pid PID) (uint64, error)
- func (p *Proc) LoadMountNSOldestProcesses() (map[NamespaceID]PID, error)
- func (p *Proc) SnapshotProcessTree(targetPID PID) ([]Process, error)
- type ProcFS
- type Process
Constants ¶
View Source
const Path = "/proc"
Path to proc filesystem.
Variables ¶
View Source
var ( ErrCannotGetPIDNSInode = errors.New("cannot get pidns inode") ErrParseStatFileInvalidCommFormat = errors.New("cannot parse stat file, invalid comm format") ErrParseStatFileNotEnoughFields = errors.New("cannot parse stat file, not enough fields") ErrNoCgroupPathFound = errors.New("no cgroup path found") )
Functions ¶
func HostPath ¶ added in v1.7.0
HostPath returns full file path on the host file system using procfs, eg: /proc/1/root/<my-path>
func LoadSymbolAddresses ¶ added in v1.22.0
Types ¶
type NamespaceID ¶
type NamespaceID = uint64
type NamespaceType ¶
type NamespaceType string
const ( PIDNamespace NamespaceType = "pid" MountNamespace NamespaceType = "mnt" )
type Proc ¶
type Proc struct {
// contains filtered or unexported fields
}
func (*Proc) FindCGroupPathForPID ¶ added in v1.15.0
func (*Proc) GetCurrentPIDNSID ¶
func (p *Proc) GetCurrentPIDNSID() (NamespaceID, error)
func (*Proc) GetNSForPID ¶
func (p *Proc) GetNSForPID(pid PID, ns NamespaceType) (NamespaceID, error)
func (*Proc) GetProcessStartTime ¶
GetProcessStartTime parses the /proc/<pid>/stat file to determine the start time of the process after system boot.
func (*Proc) LoadMountNSOldestProcesses ¶
func (p *Proc) LoadMountNSOldestProcesses() (map[NamespaceID]PID, error)
func (*Proc) SnapshotProcessTree ¶ added in v1.15.0
SnapshotProcessTree records a snappshot of the current process tree in the PID namespace of the given targetPID. This is done by iterating over files exposed from the `/proc` filesystem.
Click to show internal directories.
Click to hide internal directories.