Include procfs and sysfs data collection time in the system summary
row of the "usec" column. This is useful for isolating where the
time goes during turbostat data collection.
Background:
Column "usec" shows
1. the number of microseconds elapsed during counter collection,
including thread migration -- if any, for each CPU row.
2. total elapsed time to collect the counters on all cpus, for the
summary row.
This can be used to check the time cost of a give column. For example,
run below commands separately
turbostat --show usec sleep 1
turbostat --show usec,CoreTmp sleep 1
and the delta in the usec column will tell the time cost for CoreTmp
(Thermal MSR read)
Problem:
Some of the kernel procfs/sysfs accesses are expensive, especially on
high core count systems. "usec" column cannot tell this because it only
includes the time cost of the counters.
Solution:
Leave the per CPU "usec" as it is and modify the summary "usec" to
include the time cost of the procfs/sysfs snapshot.
With it, the "usec" column can be used to get
1. the baseline, e.g.
turbostat --show usec sleep 1
2. the baseline + some per CPU counter cost, e.g.
turbostat --show usec,CoreTmp sleep 1
3. the baseline + some per CPU sysfs cost, e.g.
turbostat --show usec,C1 sleep 1
4. the baseline + /proc/interrupts cost, e.g
turbostat --show usec,IRQ sleep 1
Man-page update is also included.
Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>