Documentation ¶
Overview ¶
Package pstree provides an API to retrieve the process tree from procfs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Process ¶
type Process struct { Name string `json:"name"` Stat ProcessStat `json:"stat"` Children []int `json:"children"` }
Process stores information about a UNIX process.
type ProcessStat ¶
type ProcessStat struct { PID int `json:"pid"` // process ID Comm string `json:"comm"` // filename of the executable in parentheses State byte `json:"state"` // process state Ppid int `json:"ppid"` // pid of the parent process Pgrp int `json:"pgrp"` // process group ID of the process Session int `json:"session"` // session ID of the process TTY int `json:"tty"` // controlling terminal of the process Tpgid int `json:"tpgid"` // ID of foreground process group Flags uint32 `json:"flags"` // kernel flags word of the process Minflt uint64 `json:"minflt"` // number of minor faults the process has made which have not required loading a memory page from disk Cminflt uint64 `json:"cminflt"` // number of minor faults the process's waited-for children have made Majflt uint64 `json:"majflt"` // number of major faults the process has made which have required loading a memory page from disk Cmajflt uint64 `json:"cmajflt"` // number of major faults the process's waited-for children have made Utime uint64 `json:"utime"` // user time in clock ticks Stime uint64 `json:"stime"` // system time in clock ticks Cutime int64 `json:"cutime"` // children user time in clock ticks Cstime int64 `json:"cstime"` // children system time in clock ticks Priority int64 `json:"priority"` // priority Nice int64 `json:"nice"` // the nice value Nthreads int64 `json:"nthreads"` // number of threads in this process Itrealval int64 `json:"itrealval"` // time in jiffies before next SIGALRM is sent to the process due to an interval timer Starttime int64 `json:"starttime"` // time the process started after system boot in clock ticks Vsize uint64 `json:"vsize"` // virtual memory size in bytes RSS int64 `json:"rss"` // resident set size: number of pages the process has in real memory Environ string `json:"environ"` // environment for the process Cwd string `json:"cwd"` // current working directory for the process Cmdline string `json:"cmdline"` // complete command line for the process }
ProcessStat contains process information. see: http://man7.org/linux/man-pages/man5/proc.5.html
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
procs-tree
Command procs-tree displays the tree of children processes for a given PID.
|
Command procs-tree displays the tree of children processes for a given PID. |
Click to show internal directories.
Click to hide internal directories.