Documentation ¶
Overview ¶
Package ptree contains utilities for dealing with Linux process trees.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetProcessRSSAnon ¶
Return the RSSAnon of a single process `pid`.
func GetProcessTreeRSSAnon ¶
Return the total RSS of the tree of processes rooted at `pid`.
If the passed root pid is that of a kernel thread, as a special case, we return zero and no error.
Errors encountered while walking the children are ignored, since it can change while traversing it.
func ParseRSSAnon ¶
parseRSSAnon parses an "RssAnon" line from /proc/*/status and returns the size. The entire line should be passed in, with or without the line ending. If the line looks like "RssAnon: 1234 kB", the byte size will be returned. If the line isn't parseable, (0, false) will be returned.
func WalkChildren ¶
Walk the child processes of the specified root process. walkFn will be called for each child found. It will not be called for the root process. Any errors will be ignored, since they may be just a consequence of the process tree changing during traversal.
Types ¶
This section is empty.