mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
Commit525e0064f3("powercap: intel_rapl: Expose all package CPUs in PMU cpumask") expanded cpumask to include all CPUs in the package. Since perf opens an event for every CPU in cpumask, the value returned for power/energy-pkg/ is roughly scaled by the number of CPUs. On a single-socket 72-core DMR machine the reported value is roughly 72x higher than when perf is restricted to reading from a single CPU: $ perf stat -e power/energy-pkg/ -- sleep 1 Performance counter stats for 'system wide': 8,052.48 Joules power/energy-pkg/ 1.010483558 seconds time elapsed $ perf stat -C 5 -e power/energy-pkg/ -- sleep 1 Performance counter stats for 'CPU(s) 5': 112.15 Joules power/energy-pkg/ 1.009685587 seconds time elapsed Reverting this commit restores the expected behavior for perf. Fixes:525e0064f3("powercap: intel_rapl: Expose all package CPUs in PMU cpumask") Cc: All applicable <[email protected]> Signed-off-by: Dennis Chen <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>