]> git.baikalelectronics.ru Git - kernel.git/commit
tools/power turbostat: KNL workaround for %Busy and Avg_MHz
authorHubert Chrzaniuk <hubert.chrzaniuk@intel.com>
Mon, 14 Sep 2015 11:31:00 +0000 (13:31 +0200)
committerLen Brown <len.brown@intel.com>
Sat, 26 Sep 2015 04:50:54 +0000 (00:50 -0400)
commit4a56abeafd40f57f3ffca7f520035b5733995c07
tree1613d67821a25330cee5cdb348c41675f0cb177d
parenta6d8155f2647fc3abda5f697ae45cf9c6404462f
tools/power turbostat: KNL workaround for %Busy and Avg_MHz

KNL increments APERF and MPERF every 1024 clocks.
This is compliant with the architecture specification,
which requires that only the ratio of APERF/MPERF need be valid.

However, turbostat takes advantage of the fact that these
two MSRs increment every un-halted clock
at the actual and base frequency:

AVG_MHz = APERF_delta/measurement_interval

%Busy = MPERF_delta/TSC_delta

This quirk is needed for these calculations to also work on KNL,
which would otherwise show a value 1024x smaller than expected.

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