ptree

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: MIT Imports: 8 Imported by: 0

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

func GetProcessRSSAnon(pid int) (uint64, error)

Return the RSSAnon of a single process `pid`.

func GetProcessTreeRSSAnon

func GetProcessTreeRSSAnon(pid int) (uint64, error)

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

func ParseRSSAnon(s string) (uint64, bool)

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

func WalkChildren(pid int, walkFn func(int))

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.

Jump to

Keyboard shortcuts

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