Skip to main content

Module scan

Module scan 

Source
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 stat fields to a row.
is_same_process
Whether /proc/<pid> still refers to the same process identified by starttime. Used to detect PID reuse between two samples.
list_pids
List process IDs by scanning /proc for 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 stat file of one process.
read_thread_stat
Read stat for one thread of pid.
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_percent from /sys/module/zswap/parameters.