When the kernel has an offline CPU, it only renders the online CPUs in
/proc/stat.
When in non-use_view mode, /sys/devices/system/cpu/online shows the CPU
numbers as they actually are on the physical system, but /proc/stat used
"virtual" (i.e. always zero-indexed) numbers, which causes confusion for
some applications. Let's use the same use_view logic in /proc/stat as well.
(root) ~ # chcpu -d 4
CPU 4 disabled
(root) ~ # cat /sys/devices/system/cpu/online
0-3,5-7
(root) ~ # cat /proc/stat
cpu
5599257 116799
1924319 150675607 147630 0 51038 2454 0 0
cpu0 664385 19911 221078
19009148 14812 0 9832 2238 0 0
cpu1 783128 16478 282310
18416428 14325 0 6287 27 0 0
cpu2 822527 15344 275820
18355637 11215 0 5762 26 0 0
cpu3 807309 15631 277152
18399668 9697 0 7623 27 0 0
cpu5 712191 13680 245495
20759989 13959 0 6968 46 0 0
cpu6 728409 14828 247631
20794157 40037 0 5624 29 0 0
cpu7 709679 14321 251154
20785870 18872 0 6226 32 0 0
intr
10891106673 0 10 0 0 418 0 0 0 0 1 0 0 3 0 0 0 0 0 0 0 0 0 0 0 8 8 406552 434812
1863708 2335638 258448
3878047 1907518 1500768 1860249 1506066 1743056 1527121 1564894 258398 779468 275941 275383 277085 271838 271729 273211 271677 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ctxt
814064094
btime
1666730552
processes
5152733
procs_running 1
procs_blocked 0
softirq
772324623 4
31396133 263035
39649581 20 4
1593903 442777055 51
256644837
Signed-off-by: Tycho Andersen <tycho@tycho.pizza>