From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752377Ab3LPUUT (ORCPT ); Mon, 16 Dec 2013 15:20:19 -0500 Received: from mail-we0-f181.google.com ([74.125.82.181]:39535 "EHLO mail-we0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752328Ab3LPUUO (ORCPT ); Mon, 16 Dec 2013 15:20:14 -0500 From: Stephane Eranian To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@elte.hu, ak@linux.intel.com, acme@redhat.com, jolsa@redhat.com, zheng.z.yan@intel.com, bp@alien8.de, vincent.weaver@maine.edu, maria.n.dimakopoulou@gmail.com Subject: [PATCH 2/2] perf/x86: add RAPL PP1 energy counter support Date: Mon, 16 Dec 2013 21:20:24 +0100 Message-Id: <1387225224-27799-3-git-send-email-eranian@google.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1387225224-27799-1-git-send-email-eranian@google.com> References: <1387225224-27799-1-git-send-email-eranian@google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for the RAPL energy counter PP1. On client processors, it usually correspondss to the energy consumption of the builtin graphic card. New event: - name: power/energy-gfx/ - code: event=0x4 - unit: 2^-32 Joules On processors without graphics, this should count 0. The patch only enables this event on client processors. Signed-off-by: Stephane Eranian --- arch/x86/kernel/cpu/perf_event_intel_rapl.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c index 0e3754e..b2dc346 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c +++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c @@ -55,10 +55,13 @@ #define INTEL_RAPL_PKG 0x2 /* pseudo-encoding */ #define RAPL_IDX_RAM_NRG_STAT 2 /* DRAM */ #define INTEL_RAPL_RAM 0x3 /* pseudo-encoding */ +#define RAPL_IDX_PP1_NRG_STAT 3 /* DRAM */ +#define INTEL_RAPL_PP1 0x4 /* pseudo-encoding */ /* Clients have PP0, PKG */ #define RAPL_IDX_CLN (1<