1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Linux platform implementation
pub use read_cpu_stats;
pub use read_gpu_stats;
pub use read_memory_stats;
pub use detect_platform;
pub use read_power_stats;
pub use read_temperature_stats;
/// Bytes per memory page, from `sysconf(_SC_PAGESIZE)`.
///
/// `/proc/<pid>/statm` counts pages, and the readers multiplied by a literal
/// 4096. That is x86's page size and a common ARM64 one, not every machine's:
/// ARM64 kernels are also built with 16 KiB pages (Apple Silicon under Asahi)
/// and 64 KiB pages (several server distributions), where every process's
/// memory read four or sixteen times too small.
/// Clock ticks per second, from `sysconf(_SC_CLK_TCK)`: the unit of the CPU
/// times in `/proc/<pid>/stat`.
///
/// The readers divided by a literal 100. That is `USER_HZ` on most kernels,
/// and it is a kernel configuration value rather than a constant.