[PATCH] powerpc/perf: Add POWER9 alternate PM_RUN_CYC and PM_RUN_INST_CMPL events

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE3312d

3 messages, 3 authors, 2017-07-13 · open the first message on its own page

[PATCH] powerpc/perf: Add POWER9 alternate PM_RUN_CYC and PM_RUN_INST_CMPL events

From: Anton Blanchard <hidden>
Date: 2017-06-18 23:51:33

From: Anton Blanchard <redacted>

Similar to POWER8, POWER9 can count run cycles and run instructions
completed on more than one PMU.

Signed-off-by: Anton Blanchard <redacted>
---
 arch/powerpc/perf/power9-events-list.h | 4 ++++
 arch/powerpc/perf/power9-pmu.c         | 2 ++
 2 files changed, 6 insertions(+)
diff --git a/arch/powerpc/perf/power9-events-list.h b/arch/powerpc/perf/power9-events-list.h
index 71a6bfee5c02..e9e417eefa59 100644
--- a/arch/powerpc/perf/power9-events-list.h
+++ b/arch/powerpc/perf/power9-events-list.h
@@ -51,8 +51,12 @@ EVENT(PM_DTLB_MISS,				0x300fc)
 EVENT(PM_ITLB_MISS,				0x400fc)
 /* Run_Instructions */
 EVENT(PM_RUN_INST_CMPL,				0x500fa)
+/* Alternate event code for PM_RUN_INST_CMPL */
+EVENT(PM_RUN_INST_CMPL_ALT,			0x400fa)
 /* Run_cycles */
 EVENT(PM_RUN_CYC,				0x600f4)
+/* Alternate event code for Run_cycles */
+EVENT(PM_RUN_CYC_ALT,				0x200f4)
 /* Instruction Dispatched */
 EVENT(PM_INST_DISP,				0x200f2)
 EVENT(PM_INST_DISP_ALT,				0x300f2)
diff --git a/arch/powerpc/perf/power9-pmu.c b/arch/powerpc/perf/power9-pmu.c
index 018f8e90ac35..b9168163b2b2 100644
--- a/arch/powerpc/perf/power9-pmu.c
+++ b/arch/powerpc/perf/power9-pmu.c
@@ -107,6 +107,8 @@ extern struct attribute_group isa207_pmu_format_group;
 /* Table of alternatives, sorted by column 0 */
 static const unsigned int power9_event_alternatives[][MAX_ALT] = {
 	{ PM_INST_DISP,			PM_INST_DISP_ALT },
+	{ PM_RUN_CYC_ALT,		PM_RUN_CYC },
+	{ PM_RUN_INST_CMPL_ALT,		PM_RUN_INST_CMPL },
 };
 
 static int power9_get_alternatives(u64 event, unsigned int flags, u64 alt[])
-- 
2.11.0

Re: [PATCH] powerpc/perf: Add POWER9 alternate PM_RUN_CYC and PM_RUN_INST_CMPL events

From: Madhavan Srinivasan <hidden>
Date: 2017-06-27 07:48:55

On Monday 19 June 2017 05:21 AM, Anton Blanchard wrote:
From: Anton Blanchard <redacted>

Similar to POWER8, POWER9 can count run cycles and run instructions
completed on more than one PMU.
Acked-by: Madhavan Srinivasan <redacted>

quoted hunk
Signed-off-by: Anton Blanchard <redacted>
---
  arch/powerpc/perf/power9-events-list.h | 4 ++++
  arch/powerpc/perf/power9-pmu.c         | 2 ++
  2 files changed, 6 insertions(+)
diff --git a/arch/powerpc/perf/power9-events-list.h b/arch/powerpc/perf/power9-events-list.h
index 71a6bfee5c02..e9e417eefa59 100644
--- a/arch/powerpc/perf/power9-events-list.h
+++ b/arch/powerpc/perf/power9-events-list.h
@@ -51,8 +51,12 @@ EVENT(PM_DTLB_MISS,				0x300fc)
  EVENT(PM_ITLB_MISS,				0x400fc)
  /* Run_Instructions */
  EVENT(PM_RUN_INST_CMPL,				0x500fa)
+/* Alternate event code for PM_RUN_INST_CMPL */
+EVENT(PM_RUN_INST_CMPL_ALT,			0x400fa)
  /* Run_cycles */
  EVENT(PM_RUN_CYC,				0x600f4)
+/* Alternate event code for Run_cycles */
+EVENT(PM_RUN_CYC_ALT,				0x200f4)
  /* Instruction Dispatched */
  EVENT(PM_INST_DISP,				0x200f2)
  EVENT(PM_INST_DISP_ALT,				0x300f2)
diff --git a/arch/powerpc/perf/power9-pmu.c b/arch/powerpc/perf/power9-pmu.c
index 018f8e90ac35..b9168163b2b2 100644
--- a/arch/powerpc/perf/power9-pmu.c
+++ b/arch/powerpc/perf/power9-pmu.c
@@ -107,6 +107,8 @@ extern struct attribute_group isa207_pmu_format_group;
  /* Table of alternatives, sorted by column 0 */
  static const unsigned int power9_event_alternatives[][MAX_ALT] = {
  	{ PM_INST_DISP,			PM_INST_DISP_ALT },
+	{ PM_RUN_CYC_ALT,		PM_RUN_CYC },
+	{ PM_RUN_INST_CMPL_ALT,		PM_RUN_INST_CMPL },
  };

  static int power9_get_alternatives(u64 event, unsigned int flags, u64 alt[])

Re: powerpc/perf: Add POWER9 alternate PM_RUN_CYC and PM_RUN_INST_CMPL events

From: Michael Ellerman <hidden>
Date: 2017-07-13 12:46:41

On Sun, 2017-06-18 at 23:51:28 UTC, Anton Blanchard wrote:
From: Anton Blanchard <redacted>

Similar to POWER8, POWER9 can count run cycles and run instructions
completed on more than one PMU.

Signed-off-by: Anton Blanchard <redacted>
Acked-by: Madhavan Srinivasan <redacted>
Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/3f0bd8dad0db73f5d71b355aec5ab3

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help