From: Huang Rui <ray.huang@amd.com>
To: "Borislav Petkov" <bp@suse.de>,
"Peter Zijlstra" <peterz@infradead.org>,
"Ingo Molnar" <mingo@kernel.org>,
"Andy Lutomirski" <luto@amacapital.net>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Robert Richter" <rric@kernel.org>,
"Jacob Shin" <jacob.w.shin@gmail.com>,
"John Stultz" <john.stultz@linaro.org>,
"Frédéric Weisbecker" <fweisbec@gmail.com>
Cc: <linux-kernel@vger.kernel.org>, <spg_linux_kernel@amd.com>,
<x86@kernel.org>, Guenter Roeck <linux@roeck-us.net>,
Andreas Herrmann <herrmann.der.user@googlemail.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
Borislav Petkov <bp@alien8.de>,
"Fengguang Wu" <fengguang.wu@intel.com>,
Aaron Lu <aaron.lu@intel.com>, Huang Rui <ray.huang@amd.com>
Subject: [PATCH 0/4] perf/x86/power: Introduce AMD accumlated power reporting mechanism
Date: Thu, 7 Jan 2016 10:26:10 +0800 [thread overview]
Message-ID: <1452133574-3407-1-git-send-email-ray.huang@amd.com> (raw)
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
next reply other threads:[~2016-01-07 2:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-07 2:26 Huang Rui [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1452133574-3407-1-git-send-email-ray.huang@amd.com \
--to=ray.huang@amd.com \
--cc=Aravind.Gopalakrishnan@amd.com \
--cc=aaron.lu@intel.com \
--cc=bp@alien8.de \
--cc=bp@suse.de \
--cc=fengguang.wu@intel.com \
--cc=fweisbec@gmail.com \
--cc=herrmann.der.user@googlemail.com \
--cc=jacob.w.shin@gmail.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rric@kernel.org \
--cc=spg_linux_kernel@amd.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox