proc

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPIDs

func GetPIDs() ([]string, error)

GetPIDs extracts and returns all PIDs from /proc.

func GetPIDsFromCgroup

func GetPIDsFromCgroup(pid string) ([]string, error)

GetPIDsFromCgroup returns a strings slice of all pids listesd in pid's pids cgroup. It automatically detects if we're running in unified mode or not.

func ParseAttrCurrent

func ParseAttrCurrent(pid string) (string, error)

func ParseCmdLine

func ParseCmdLine(pid string) ([]string, error)

func ParsePIDNamespace

func ParsePIDNamespace(pid string) (string, error)

func ParseUserNamespace

func ParseUserNamespace(pid string) (string, error)

Types

type IDMap

type IDMap struct {
	ContainerID int
	HostID      int
	Size        int
}

func ReadMappings

func ReadMappings(path string) ([]IDMap, error)

type Stat

type Stat struct {
	Pid         string
	Comm        string
	State       string
	Ppid        string
	Pgrp        string
	Session     string
	TtyNr       string
	Tpgid       string
	Flags       string
	Minflt      string
	Cminflt     string
	Majflt      string
	Cmajflt     string
	Utime       string
	Stime       string
	Cutime      string
	Cstime      string
	Priority    string
	Nice        string
	NumThreads  string
	Itrealvalue string
	Starttime   string
	Vsize       string
}

func ParseStat

func ParseStat(pid string) (*Stat, error)

ParseStat parses the /proc/$pid/stat file and returns a Stat.

type Status

type Status struct {
	Name                     string
	Umask                    string
	State                    string
	Tgid                     string
	Ngid                     string
	Pid                      string
	PPid                     string
	TracerPid                string
	Uids                     []string
	Gids                     []string
	FdSize                   string
	Groups                   []string
	NStgid                   string
	NSpid                    []string
	NSpgid                   string
	NSsid                    string
	VMPeak                   string
	VMSize                   string
	VMLCK                    string
	VMPin                    string
	VMHWM                    string
	VMRSS                    string
	RssAnon                  string
	RssFile                  string
	RssShmem                 string
	VMData                   string
	VMStk                    string
	VMExe                    string
	VMLib                    string
	VMPTE                    string
	VMPMD                    string
	VMSwap                   string
	HugetlbPages             string
	Threads                  string
	SigQ                     string
	SigPnd                   string
	ShdPnd                   string
	SigBlk                   string
	SigIgn                   string
	SigCgt                   string
	CapInh                   string
	CapPrm                   string
	CapEff                   string
	CapBnd                   string
	CapAmb                   string
	NoNewPrivs               string
	Seccomp                  string
	CpusAllowed              string
	CpusAllowedList          string
	MemsAllowed              string
	MemsAllowedList          string
	VoluntaryCtxtSwitches    string
	NonvoluntaryCtxtSwitches string
}

func ParseStatus

func ParseStatus(pid string, joinUserNS bool) (*Status, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL