]> git.baikalelectronics.ru Git - kernel.git/commit
tools/power turbostat: relax dependency on invariant TSC
authorLen Brown <len.brown@intel.com>
Fri, 23 Jan 2015 05:12:33 +0000 (00:12 -0500)
committerLen Brown <len.brown@intel.com>
Mon, 9 Feb 2015 23:28:08 +0000 (18:28 -0500)
commit1bab74f1ec5a5bd0a24a70783c1569bb7bef3323
tree884d0376a050c9118a6cd4ce33693061727e7791
parenta102a11f642a5df749952994016c705e30929678
tools/power turbostat: relax dependency on invariant TSC

Turbostat can be useful on systems that do not support invariant TSC,
so allow it to run on those systgems.

All arithmetic in turbostat using the TSC value is per-processsor,
so it does not depend on the TSC values being in sync acrosss processors.

Turbostat uses gettimeofday() for the measurement interval
rather than using the TSC directly, so that key metric
is also immune from variable TSC.

Turbostat prints a TSC sanity check column:

TSC_MHz = TSC_delta/interval

If this column is constant and is close to the processor
base frequency, then the TSC is behaving properly.

The other key turbostat columns are calculated this way:

Avg_Mhz = APERF_delta/interval

%Busy = MPERF_delta/TSC_delta

Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/interval

Tested on Core2 and Core2-Xeon, and so this patch includes
a few other changes to remove the assumption that target
systems are Nehalem and newer.

Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c