lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1452739808-11871-1-git-send-email-ray.huang@amd.com>
Date:	Thu, 14 Jan 2016 10:50:03 +0800
From:	Huang Rui <ray.huang@....com>
To:	Borislav Petkov <bp@...e.de>,
	Peter Zijlstra <peterz@...radead.org>,
	"Ingo Molnar" <mingo@...nel.org>,
	Andy Lutomirski <luto@...capital.net>,
	"Thomas Gleixner" <tglx@...utronix.de>,
	Robert Richter <rric@...nel.org>,
	Jacob Shin <jacob.w.shin@...il.com>,
	John Stultz <john.stultz@...aro.org>,
	Frédéric Weisbecker <fweisbec@...il.com>
CC:	<linux-kernel@...r.kernel.org>, <spg_linux_kernel@....com>,
	<x86@...nel.org>, Guenter Roeck <linux@...ck-us.net>,
	Andreas Herrmann <herrmann.der.user@...glemail.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@....com>,
	Aravind Gopalakrishnan <Aravind.Gopalakrishnan@....com>,
	Borislav Petkov <bp@...en8.de>,
	"Fengguang Wu" <fengguang.wu@...el.com>,
	Aaron Lu <aaron.lu@...el.com>, Huang Rui <ray.huang@....com>
Subject: [PATCH v2 0/5] perf/x86/power: Introduce AMD accumlated power reporting mechanism

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].


Changes from v1 -> v2:
- Add a patch to fix the build issue which is reported by kbuild test
  robot.


Simple example:

root@...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@...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 (5):
  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: Move events_sysfs_show outside CPU_SUP_INTEL
  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.h           |   6 +-
 arch/x86/kernel/cpu/perf_event_amd_power.c | 531 +++++++++++++++++++++++++++++
 6 files changed, 564 insertions(+), 8 deletions(-)
 create mode 100644 arch/x86/kernel/cpu/perf_event_amd_power.c

-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ