]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tools/power turbostat: simplify Bzy_MHz calculation
authorLen Brown <len.brown@intel.com>
Tue, 20 Oct 2015 02:37:40 +0000 (22:37 -0400)
committerDhaval Giani <dhaval.giani@oracle.com>
Mon, 16 Jan 2017 20:11:00 +0000 (15:11 -0500)
commiteea17ca520339de7ae98e67a12146d6a4ec218e4
tree3c88a276a63d5e30cfb7a014b0da4d41816b9002
parent76b9bc5656f9a7044127135ea82597b630c8022a
tools/power turbostat: simplify Bzy_MHz calculation

Orabug: 24811361

    Bzy_MHz = TSC_delta*tsc_tweak/APERF_delta/MPERF_delta/measurement_interval

becomes

    Bzy_MHz = base_mhz/APERF_delta/MPERF_delta

on systems which support MSR_NHM_PLATFORM_INFO.

base_mhz is calculated directly from the base_ratio
reported in MSR_NHM_PLATFORM_INFO * bclk,
and bclk is discovered via MSR or cpuid.

This reduces the dependency of Bzy_MHz calculation on the TSC.
Previously, there were 4 TSC readings required in each caculation,
the raw TSC delta combined with the measurement_interval.
This also removes the "tsc_tweak" correction factor used when
TSC runs on a different base clock from the CPU's bclk.

After this change, tsc_tweak is used only for %Busy.

The end-result should be a Bzy_MHz result slightly less prone to jitter.

Signed-off-by: Len Brown <len.brown@intel.com>
(cherry picked from commit 21ed5574d1622118b49b0c6342acc8d27d0799be)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
tools/power/x86/turbostat/turbostat.c