Skip to main content

Module parse

Module parse 

Source
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.
StatFields

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/diskstats device name looks like a whole disk.
parse_diskstats
Parse /proc/diskstats into cumulative host counters.
parse_fdinfo_drm
Parse one fdinfo file for drm-* keys.
parse_loadavg
Parse /proc/loadavg : 0.52 0.58 0.59 1/1234 5678.
parse_meminfo
Parse /proc/meminfo into MemInfo/SwapInfo (values in bytes).
parse_net_dev
Parse /proc/net/dev into cumulative host counters.
parse_proc_stat
Parse /proc/stat into [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>/status for the effective UID and thread count.
parse_zram_mm_stat
Parse one /sys/block/zram<N>/mm_stat line.