forked from external/yambar
/proc/stat lists CPU usage, in the form: cpu ... cpu0 ... cpu1 ... ... cpuN ... where the first line is a summary line. We’ve been using the CPU numbers from /proc/stat to index into our internal stats array. This doesn’t work on systems where the core IDs aren’t consecutive. Examples of such systems are SMT systems with SMT disabled. Here, /proc/stat may look like this instead: cpu ... cpu0 ... cpu2 ... cpu4 ... ... With this patch, we ignore the CPU ID from /proc/stat. Instead, we use a simple counter that is incremented for each (valid) cpu line found in /proc/stat. To protect against corrupt /proc/stat content, stop parsing /proc/stat if the number of parsed CPU lines exceed what we consider to the be total number of CPUs in the system. Closes #172 |
||
---|---|---|
.. | ||
alsa.c | ||
backlight.c | ||
battery.c | ||
clock.c | ||
cpu.c | ||
foreign-toplevel.c | ||
i3-common.c | ||
i3-common.h | ||
i3-ipc.h | ||
i3.c | ||
label.c | ||
mem.c | ||
meson.build | ||
mpd.c | ||
network.c | ||
removables.c | ||
river.c | ||
script.c | ||
sway-xkb.c | ||
xkb.c | ||
xwindow.c |