Tiny Patch Gets AMD Per-Core Energy Monitoring For Linux's Perf

Written by Michael Larabel in AMD on 18 February 2023 at 11:50 AM EST. 8 Comments
AMD
Exposed via Linux's very versatile perf subsystem has been per-package energy monitoring via the RAPL (Run-Time Average Power Limiting) counters. But AMD's counters also support per-core energy monitoring and now with a tiny kernel patch those sensors too will be exposed via perf.

AMD's Linux perf integration around the power reporting for their processors has mistakenly left out per-core energy monitoring support. With just reworking two lines of code, that power consumption information on a per-core basis will now be exposed to perf.

sudo perf stat -a --per-core -C 0-127 -e power/energy-cores/


As with the other CPU power reporting, for security reasons it's limited to root/superviser mode perf execution.

This patch gets the per-core RAPL reporting working under perf with modern AMD Ryzen/EPYC processors.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week