linux/tools/power/x86/turbostat
Len Brown 95149369c1 tools/power turbostat: fix impossibly large CPU%c1 value
Most CPUs do not have a hardware c1 counter,
and so turbostat derives c1 residency:

c1 = TSC - MPERF - other_core_cstate_counters

As it is not possible to atomically read these coutners,
measurement jitter can case this calcuation to "go negative"
when very close to 0.  Turbostat detect that case and
simply prints c1 = 0.00%

But that check neglected to account for systems where the TSC
crystal clock domain and the MPERF BCLK domain are differ by
a small amount.  That allowed very small negative c1 numbers
to escape this check and be printed as huge positve numbers.

This code begs for a bit of cleanup, but this patch
is the minimal change to fix the issue.

Signed-off-by: Len Brown <len.brown@intel.com>
2017-04-12 20:03:50 -04:00
..
.gitignore turbostat: Add a .gitignore to ignore the compiled turbostat binary 2014-01-18 22:34:10 -05:00
Makefile tools/power turbostat: use intel-family.h model strings 2016-12-01 01:33:19 -05:00
turbostat.8 tools/power turbostat: turbostat.8 add missing column definitions 2017-04-12 20:03:49 -04:00
turbostat.c tools/power turbostat: fix impossibly large CPU%c1 value 2017-04-12 20:03:50 -04:00