Expand description
Pure /proc parsers.
Every function here takes &[u8] rather than a path so that the whole parser
layer is testable against committed fixtures on any OS
(docs/DESIGN.md §10).
Structs§
- GpuUsage
- One process’s GPU counters, accumulated over its open DRM file descriptors.
- Stat
Fields
Functions§
- classify
- Classify a row as a kernel thread or a userland thread.
- fill_
row - Apply parsed stat fields to a row, converting pages to bytes.
- looks_
like_ whole_ disk - Whether a
/proc/diskstatsdevice name looks like a whole disk. - parse_
diskstats - Parse
/proc/diskstatsinto cumulative host counters. - parse_
fdinfo_ drm - Parse one
fdinfofile fordrm-*keys. - parse_
loadavg - Parse
/proc/loadavg:0.52 0.58 0.59 1/1234 5678. - parse_
meminfo - Parse
/proc/meminfointoMemInfo/SwapInfo(values in bytes). - parse_
net_ dev - Parse
/proc/net/devinto cumulative host counters. - parse_
proc_ stat - Parse
/proc/statinto[aggregate, cpu0, cpu1, ...]. - parse_
psi - Parse a whole
/proc/pressure/<resource>file. - parse_
psi_ line - Parse one line of
/proc/pressure/<resource>. - parse_
stat - Parse
/proc/<pid>/stat. - parse_
status_ uid - Parse
/proc/<pid>/statusfor the effective UID and thread count. - parse_
zram_ mm_ stat - Parse one
/sys/block/zram<N>/mm_statline.