The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/4] perf/x86/power: Introduce AMD accumlated power reporting mechanism
@ 2016-01-07  2:26 Huang Rui
  2016-01-07  2:26 ` [PATCH 1/4] x86/amd: move nodes_per_socket into bsp_init_amd Huang Rui
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Huang Rui @ 2016-01-07  2:26 UTC (permalink / raw)
  To: Borislav Petkov, Peter Zijlstra, Ingo Molnar, Andy Lutomirski,
	Thomas Gleixner, Robert Richter, Jacob Shin, John Stultz,
	Frédéric Weisbecker
  Cc: linux-kernel, spg_linux_kernel, x86, Guenter Roeck,
	Andreas Herrmann, Suravee Suthikulpanit, Aravind Gopalakrishnan,
	Borislav Petkov, Fengguang Wu, Aaron Lu, Huang Rui

Hi,

This series of patches introduces the perf implementation of
accumulated power reporting algorithm. It will calculate the average
power consumption for the processor. The CPU feature flag is
CPUID.8000_0007H:EDX[12].

Simple example:

root@hr-zp:/home/ray/tip# ./tools/perf/perf stat -a -e 'power/power-pkg/' make -j4
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  SKIPPED include/generated/compile.h
  Building modules, stage 2.
Kernel: arch/x86/boot/bzImage is ready  (#40)
  MODPOST 4225 modules

 Performance counter stats for 'system wide':

            183.44 mWatts power/power-pkg/

     341.837270111 seconds time elapsed

root@hr-zp:/home/ray/tip# ./tools/perf/perf stat -a -e 'power/power-pkg/' sleep 10

 Performance counter stats for 'system wide':

              0.18 mWatts power/power-pkg/

      10.012551815 seconds time elapsed

Reference:
http://lkml.kernel.org/r/20150831160622.GA29830@nazgul.tnic

Thanks,
Rui

Huang Rui (4):
  x86/amd: move nodes_per_socket into bsp_init_amd
  x86/amd: add accessor for number of cores per compute unit
  x86/cpufeature: add AMD Accumulated Power Mechanism feature flag
  perf/x86/amd/power: Add AMD accumulated power reporting mechanism

 arch/x86/include/asm/cpufeature.h          |   2 +-
 arch/x86/include/asm/processor.h           |   1 +
 arch/x86/kernel/cpu/Makefile               |   1 +
 arch/x86/kernel/cpu/amd.c                  |  31 +-
 arch/x86/kernel/cpu/perf_event_amd_power.c | 531 +++++++++++++++++++++++++++++
 5 files changed, 561 insertions(+), 5 deletions(-)
 create mode 100644 arch/x86/kernel/cpu/perf_event_amd_power.c

-- 
1.9.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-07  4:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-07  2:26 [PATCH 0/4] perf/x86/power: Introduce AMD accumlated power reporting mechanism Huang Rui
2016-01-07  2:26 ` [PATCH 1/4] x86/amd: move nodes_per_socket into bsp_init_amd Huang Rui
2016-01-07  2:26 ` [PATCH 2/4] x86/amd: add accessor for number of cores per compute unit Huang Rui
2016-01-07  2:26 ` [PATCH 3/4] x86/cpufeature: add AMD Accumulated Power Mechanism feature flag Huang Rui
2016-01-07  2:26 ` [PATCH 4/4] perf/x86/amd/power: Add AMD accumulated power reporting mechanism Huang Rui
2016-01-07  3:14   ` kbuild test robot
2016-01-07  4:40     ` Huang Rui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox