Skip to content

RFC perf: show package power consumption in perf

Zhang Rui lkml 1 version In review

Get series with b4
b4 am 1282118350.5181.115.camel@rui

Versions newest first

  1. v1 RFC Latest3 patches 20 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3perf: export perf helper functionsinclude/linux/perf_event.h kernel/perf_event.c+12 -21 reply
2/3perf: introduce new pmu and event to show package energy status in perfdrivers/platform/x86/Kconfig drivers/platform/x86/Makefile drivers/platform/x86/intel_rapl.c +1 more+227 -00 replies
3/3perf: support PERF_COUNT_SW_RAPL_ENERGY in perf tooltools/perf/design.txt tools/perf/util/parse-events.c+3 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] perf: show package power consumption in perf

Hi, all,

RAPL(running average power limit) is a new feature which provides mechanisms to enforce power consumption limit, on some new processors.

Generally speaking, by using RAPL, OS can set a power budget in a certain time window, and let Hardware to throttle the processor P/T-state to meet this energy limitation.

RAPL also provides a new MSR, i.e. MSR_PKG_ENERGY_STATUS, which reports the total amount of energy consumed by the package.

I'm not sure if to support RAPL or not, but anyway, it sounds like a good idea to export the energy status in perf.

So a new perf pmu and event to show the package energy consumed is introduced in this patch.

Here is what I get after applying the three patches,

#./perf stat -e energy test
Performance counter stats for 'test':

202 Joules cost by package
7.926001238 seconds time elapsed

Note that this patch set is made based on Peter's perf-pmu branch,
git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-perf.git
which provides better interfaces to register/unregister a new pmu.

any comment are welcome. :)

thanks,
rui