linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
	Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@ozlabs.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 55/66] perf: Power7: Make CPI stack events available in sysfs
Date: Thu, 30 May 2013 19:01:28 +0300	[thread overview]
Message-ID: <1369929699-8724-56-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1369929699-8724-1-git-send-email-acme@infradead.org>

From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>

A set of Power7 events are often used for Cycles Per Instruction (CPI) stack
analysis. Make these events available in sysfs (/sys/devices/cpu/events/) so
they can be identified using their symbolic names:

	perf stat -e 'cpu/PM_CMPLU_STALL_DCACHE_MISS/' /bin/ls

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Link: http://lkml.kernel.org/r/20130406164803.GA408@us.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 arch/powerpc/perf/power7-pmu.c | 73 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c
index 3c475d6..13c3f0e 100644
--- a/arch/powerpc/perf/power7-pmu.c
+++ b/arch/powerpc/perf/power7-pmu.c
@@ -62,6 +62,29 @@
 #define	PME_PM_BRU_FIN			0x10068
 #define	PME_PM_BRU_MPRED		0x400f6
 
+#define PME_PM_CMPLU_STALL_FXU			0x20014
+#define PME_PM_CMPLU_STALL_DIV			0x40014
+#define PME_PM_CMPLU_STALL_SCALAR		0x40012
+#define PME_PM_CMPLU_STALL_SCALAR_LONG		0x20018
+#define PME_PM_CMPLU_STALL_VECTOR		0x2001c
+#define PME_PM_CMPLU_STALL_VECTOR_LONG		0x4004a
+#define PME_PM_CMPLU_STALL_LSU			0x20012
+#define PME_PM_CMPLU_STALL_REJECT		0x40016
+#define PME_PM_CMPLU_STALL_ERAT_MISS		0x40018
+#define PME_PM_CMPLU_STALL_DCACHE_MISS		0x20016
+#define PME_PM_CMPLU_STALL_STORE		0x2004a
+#define PME_PM_CMPLU_STALL_THRD			0x1001c
+#define PME_PM_CMPLU_STALL_IFU			0x4004c
+#define PME_PM_CMPLU_STALL_BRU			0x4004e
+#define PME_PM_GCT_NOSLOT_IC_MISS		0x2001a
+#define PME_PM_GCT_NOSLOT_BR_MPRED		0x4001a
+#define PME_PM_GCT_NOSLOT_BR_MPRED_IC_MISS	0x4001c
+#define PME_PM_GRP_CMPL				0x30004
+#define PME_PM_1PLUS_PPC_CMPL			0x100f2
+#define PME_PM_CMPLU_STALL_DFU			0x2003c
+#define PME_PM_RUN_CYC				0x200f4
+#define PME_PM_RUN_INST_CMPL			0x400fa
+
 /*
  * Layout of constraint bits:
  * 6666555555555544444444443333333333222222222211111111110000000000
@@ -393,6 +416,31 @@ POWER_EVENT_ATTR(LD_MISS_L1,			LD_MISS_L1);
 POWER_EVENT_ATTR(BRU_FIN,			BRU_FIN)
 POWER_EVENT_ATTR(BRU_MPRED,			BRU_MPRED);
 
+POWER_EVENT_ATTR(CMPLU_STALL_FXU,		CMPLU_STALL_FXU);
+POWER_EVENT_ATTR(CMPLU_STALL_DIV,		CMPLU_STALL_DIV);
+POWER_EVENT_ATTR(CMPLU_STALL_SCALAR,		CMPLU_STALL_SCALAR);
+POWER_EVENT_ATTR(CMPLU_STALL_SCALAR_LONG,	CMPLU_STALL_SCALAR_LONG);
+POWER_EVENT_ATTR(CMPLU_STALL_VECTOR,		CMPLU_STALL_VECTOR);
+POWER_EVENT_ATTR(CMPLU_STALL_VECTOR_LONG,	CMPLU_STALL_VECTOR_LONG);
+POWER_EVENT_ATTR(CMPLU_STALL_LSU,		CMPLU_STALL_LSU);
+POWER_EVENT_ATTR(CMPLU_STALL_REJECT,		CMPLU_STALL_REJECT);
+
+POWER_EVENT_ATTR(CMPLU_STALL_ERAT_MISS,		CMPLU_STALL_ERAT_MISS);
+POWER_EVENT_ATTR(CMPLU_STALL_DCACHE_MISS,	CMPLU_STALL_DCACHE_MISS);
+POWER_EVENT_ATTR(CMPLU_STALL_STORE,		CMPLU_STALL_STORE);
+POWER_EVENT_ATTR(CMPLU_STALL_THRD,		CMPLU_STALL_THRD);
+POWER_EVENT_ATTR(CMPLU_STALL_IFU,		CMPLU_STALL_IFU);
+POWER_EVENT_ATTR(CMPLU_STALL_BRU,		CMPLU_STALL_BRU);
+POWER_EVENT_ATTR(GCT_NOSLOT_IC_MISS,		GCT_NOSLOT_IC_MISS);
+
+POWER_EVENT_ATTR(GCT_NOSLOT_BR_MPRED,		GCT_NOSLOT_BR_MPRED);
+POWER_EVENT_ATTR(GCT_NOSLOT_BR_MPRED_IC_MISS,	GCT_NOSLOT_BR_MPRED_IC_MISS);
+POWER_EVENT_ATTR(GRP_CMPL,			GRP_CMPL);
+POWER_EVENT_ATTR(1PLUS_PPC_CMPL,		1PLUS_PPC_CMPL);
+POWER_EVENT_ATTR(CMPLU_STALL_DFU,		CMPLU_STALL_DFU);
+POWER_EVENT_ATTR(RUN_CYC,			RUN_CYC);
+POWER_EVENT_ATTR(RUN_INST_CMPL,			RUN_INST_CMPL);
+
 static struct attribute *power7_events_attr[] = {
 	GENERIC_EVENT_PTR(CYC),
 	GENERIC_EVENT_PTR(GCT_NOSLOT_CYC),
@@ -411,6 +459,31 @@ static struct attribute *power7_events_attr[] = {
 	POWER_EVENT_PTR(LD_MISS_L1),
 	POWER_EVENT_PTR(BRU_FIN),
 	POWER_EVENT_PTR(BRU_MPRED),
+
+	POWER_EVENT_PTR(CMPLU_STALL_FXU),
+	POWER_EVENT_PTR(CMPLU_STALL_DIV),
+	POWER_EVENT_PTR(CMPLU_STALL_SCALAR),
+	POWER_EVENT_PTR(CMPLU_STALL_SCALAR_LONG),
+	POWER_EVENT_PTR(CMPLU_STALL_VECTOR),
+	POWER_EVENT_PTR(CMPLU_STALL_VECTOR_LONG),
+	POWER_EVENT_PTR(CMPLU_STALL_LSU),
+	POWER_EVENT_PTR(CMPLU_STALL_REJECT),
+
+	POWER_EVENT_PTR(CMPLU_STALL_ERAT_MISS),
+	POWER_EVENT_PTR(CMPLU_STALL_DCACHE_MISS),
+	POWER_EVENT_PTR(CMPLU_STALL_STORE),
+	POWER_EVENT_PTR(CMPLU_STALL_THRD),
+	POWER_EVENT_PTR(CMPLU_STALL_IFU),
+	POWER_EVENT_PTR(CMPLU_STALL_BRU),
+	POWER_EVENT_PTR(GCT_NOSLOT_IC_MISS),
+	POWER_EVENT_PTR(GCT_NOSLOT_BR_MPRED),
+
+	POWER_EVENT_PTR(GCT_NOSLOT_BR_MPRED_IC_MISS),
+	POWER_EVENT_PTR(GRP_CMPL),
+	POWER_EVENT_PTR(1PLUS_PPC_CMPL),
+	POWER_EVENT_PTR(CMPLU_STALL_DFU),
+	POWER_EVENT_PTR(RUN_CYC),
+	POWER_EVENT_PTR(RUN_INST_CMPL),
 	NULL
 };
 
-- 
1.8.1.4


  parent reply	other threads:[~2013-05-30 16:12 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 16:00 [GIT PULL 00/66] perf/core improvements and fixes Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 01/66] perf tools: Fix bug in isupper() and islower() Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 02/66] perf hists: Fix an invalid memory free on he->branch_info Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 03/66] perf hists: Free unused mem info of a matched hist entry Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 04/66] perf report: Fix alignment of symbol column when -v is given Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 05/66] perf sort: Introduce sort__mode variable Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 06/66] perf sort: Factor out common code in sort_dimension__add() Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 07/66] perf sort: Separate out memory-specific sort keys Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 08/66] perf sort: Consolidate sort_entry__setup_elide() Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 09/66] perf archive: Fix typo on Documentation Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 10/66] perf sort: Reorder HISTC_SRCLINE index Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 11/66] perf sort: Cleanup sort__has_sym setting Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 12/66] perf top: Use sort__has_sym Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 13/66] perf hists browser: " Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 14/66] perf tools: Fix tab vs spaces issue in Makefile ifdef/endif Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 15/66] perf tests: Fix compile errors in bp_signal files Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 16/66] perf tools: Handle JITed code in shared memory Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 17/66] perf record: handle death by SIGTERM Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 18/66] perf top: Fix -E option behavior Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 19/66] perf top: Fix percent output when no samples collected Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 20/66] perf top: Get rid of *_threaded() functions Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 21/66] perf hists: Move locking to its call-sites Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 22/66] perf report: Don't bother locking when adding hist entries Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 23/66] perf report: Add --percent-limit option Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 24/66] perf top: " Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 25/66] perf report: Add report.percent-limit config variable Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 26/66] perf diff: Use internal rb tree for hists__precompute Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 27/66] perf hists: Rename hist_entry__add_pair arguments Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 28/66] perf test: Fix typo Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 29/66] perf evsel: Fix printing of perf_event_paranoid message Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 30/66] perf kvm: Handle realloc failures Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 31/66] perf stats: Fix divide by 0 in variance Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 32/66] perf tools: Save parent pid in thread struct Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 33/66] perf tools: Add automated make test suite Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 34/66] perf tools: Move arch check into config/Makefile Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 35/66] perf tools: Move programs " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 36/66] perf tools: Move compiler and linker flags " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 37/66] perf tools: Move libelf check config " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 38/66] perf tools: Move libdw " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 39/66] perf tools: Move libunwind " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 40/66] perf tools: Move libaudit " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 41/66] perf tools: Move slang " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 42/66] perf tools: Move gtk2 " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 43/66] perf tools: Move libperl " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 44/66] perf tools: Move libpython " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 45/66] perf tools: Move libbfd " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 46/66] perf tools: Move stdlib " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 47/66] perf tools: Move libnuma " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 48/66] perf tools: Move paths " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 49/66] perf tools: Final touches for CHK config move Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 50/66] perf tests: Fix attr test for record -d option Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 51/66] perf tests: Fix exclude_guest|exclude_host checking for attr tests Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 52/66] perf tools: Remove frozen from perf_header struct Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 53/66] perf tools: Remove cwdlen from struct perf_session Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 54/66] tools lib lk: Respect CROSS_COMPILE Arnaldo Carvalho de Melo
2013-05-30 16:01 ` Arnaldo Carvalho de Melo [this message]
2013-05-30 16:01 ` [PATCH 56/66] perf: Power7 Update testing ABI to list CPI-stack events Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 57/66] perf: Expand definition of sysfs format attribute Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 58/66] perf evlist: Reset SIGTERM handler in workload child process Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 59/66] perf tools: Merge all *CFLAGS* make variable into CFLAGS Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 60/66] perf tools: Merge all *LDFLAGS* make variable into LDFLAGS Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 61/66] perf tools: Switch to full path C include directories Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 62/66] perf tools: Add NO_BIONIC variable to confiure bionic setup Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 63/66] perf tools: Replace tabs with spaces for all non-commands statements Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 64/66] perf tools: Replace multiple line assignment with multiple statements Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 65/66] perf tools: Remove '?=' Makefile STRIP assignment Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 66/66] perf tools: Add missing liblk.a dependency for python/perf.so Arnaldo Carvalho de Melo
2013-05-31 11:04 ` [GIT PULL 00/66] perf/core improvements and fixes Ingo Molnar

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=1369929699-8724-56-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=acme@redhat.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=sukadev@linux.vnet.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).