Expand description
Reading /proc and /sys.
All hot-path reads go through thread_local! scratch buffers so a scan
allocates nothing per process (docs/DESIGN.md §9.4).
Functions§
- apply_
stat - Apply
statfields to a row. - is_
same_ process - Whether
/proc/<pid>still refers to the same process identified bystarttime. Used to detect PID reuse between two samples. - list_
pids - List process IDs by scanning
/procfor numeric directory entries. - list_
tids - List the thread ids inside a process (
/proc/<pid>/task). - read_
disk_ counters - Read host-wide disk counters from
/proc/diskstats. - read_
gpu_ usage - Read
/proc/<pid>/fdinfo/*and sum every DRM descriptor’s counters. - read_
identity - Fetch (and cache) the immutable identity of one process.
- read_
loadavg - Read
/proc/loadavg. - read_
meminfo - Read
/proc/meminfo. - read_
net_ counters - Read host-wide network counters from
/proc/net/dev. - read_
proc_ stat - Read
/proc/stat. - read_
psi - Read
/proc/pressure/{cpu,memory,io,irq}. - read_
stat - Read the
statfile of one process. - read_
thread_ stat - Read
statfor one thread ofpid. - read_
uptime - Read
/proc/uptime, returning whole seconds. - read_
zram - Read every zram device’s
/sys/block/zram<N>/mm_stat. - read_
zswap_ max_ percent - Read
max_pool_percentfrom/sys/module/zswap/parameters.