tools/power turbostat: Add reading aperf and mperf via perf API
authorPatryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Thu, 11 Jan 2024 15:42:22 +0000 (16:42 +0100)
committerLen Brown <len.brown@intel.com>
Tue, 2 Apr 2024 16:50:11 +0000 (12:50 -0400)
commite48934c9f1048ed4640b60321baf1986d1a470e1
tree4e8f7ad70652941a9291a2fc6f5f6cb4835d0979
parenta0e86c90b83c118985260e36490583b5a38d4359
tools/power turbostat: Add reading aperf and mperf via perf API

By using the perf API we spend less time in between the reads of the
counters, resulting in more accurate calculations of the dependent
metrics.

Using perf API is also usually faster overall, although cache miss, if
we get one, is more costly when using perf vs MSR driver.

We would fallback to the msr reads if the sysfs isn't there or when in
--no-perf mode.

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