KernelStats::cpu_time is a Vec<CpuTime> where each entry shows the per-CPU utilization information from /proc/stat. However, it discards the CPU index from /proc/stat making it impossible to match the utilization to the originating CPU. For example, here's /proc/stat on a QEMU instance w/ 4 CPUs:
KernelStats::cpu_time will contain 3 entries but without any way to reliably find out which three CPUs are being reported. Corroborating other sources doesn't really work as there may be intervening hot[un]plug operations between reads.
It seems like KernelStats::cpu_time, instead of being a Vec, should be keyed with CPU ID read from /proc/stat.
KernelStats::cpu_time
is aVec<CpuTime>
where each entry shows the per-CPU utilization information from/proc/stat
. However, it discards the CPU index from/proc/stat
making it impossible to match the utilization to the originating CPU. For example, here's/proc/stat
on a QEMU instance w/ 4 CPUs:After taking cpu2 offline with
echo 0 > /sys/devices/system/cpu/cpu2/online
, the file looks as follows:KernelStats::cpu_time
will contain 3 entries but without any way to reliably find out which three CPUs are being reported. Corroborating other sources doesn't really work as there may be intervening hot[un]plug operations between reads.It seems like
KernelStats::cpu_time
, instead of being a Vec, should be keyed with CPU ID read from/proc/stat
.