Skip to contentSkip to conversation

powerpc/perf: Update perf_regs structure to include SIER

PATCH Superseded Madhavan Srinivasan 2 participants 3 messages Jul 10, 2018 – Aug 14, 2018

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/perf: Update perf_regs structure to include SIER

On each sample, Sample Instruction Event Register (SIER) content is saved in pt_regs. SIER does not have a entry as-is in the pt_regs but instead, SIER content is saved in the "dar" register of pt_regs.

Patch adds another entry to the perf_regs structure to include the "SIER" printing which internally maps to the "dar" of pt_regs.

Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Anju T Sudhakar <[email protected]>
Cc Ravi Bangoria <[email protected]>
---
 arch/powerpc/include/uapi/asm/perf_regs.h       | 1 +
 arch/powerpc/perf/perf_regs.c                   | 1 +
 tools/arch/powerpc/include/uapi/asm/perf_regs.h | 1 +
 tools/perf/arch/powerpc/include/perf_regs.h     | 3 ++-
 tools/perf/arch/powerpc/util/perf_regs.c        | 1 +
 5 files changed, 6 insertions(+), 1 deletion(-)
arch/powerpc/include/uapi/asm/perf_regs.h +1 -0
index 9e52c86ccbd3..ff91192407d1 100644
@@ -46,6 +46,7 @@ enum perf_event_powerpc_regs {
 	PERF_REG_POWERPC_TRAP,
 	PERF_REG_POWERPC_DAR,
 	PERF_REG_POWERPC_DSISR,
+	PERF_REG_POWERPC_SIER,
 	PERF_REG_POWERPC_MAX,
 };
 #endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */
arch/powerpc/perf/perf_regs.c +1 -0
index 09ceea6175ba..c262aea22ad9 100644
@@ -69,6 +69,7 @@ static unsigned int pt_regs_offset[PERF_REG_POWERPC_MAX] = {
 	PT_REGS_OFFSET(PERF_REG_POWERPC_TRAP, trap),
 	PT_REGS_OFFSET(PERF_REG_POWERPC_DAR, dar),
 	PT_REGS_OFFSET(PERF_REG_POWERPC_DSISR, dsisr),
+	PT_REGS_OFFSET(PERF_REG_POWERPC_SIER, dar),
 };
 
 u64 perf_reg_value(struct pt_regs *regs, int idx)
tools/arch/powerpc/include/uapi/asm/perf_regs.h +1 -0
index 9e52c86ccbd3..ff91192407d1 100644
@@ -46,6 +46,7 @@ enum perf_event_powerpc_regs {
 	PERF_REG_POWERPC_TRAP,
 	PERF_REG_POWERPC_DAR,
 	PERF_REG_POWERPC_DSISR,
+	PERF_REG_POWERPC_SIER,
 	PERF_REG_POWERPC_MAX,
 };
 #endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */
tools/perf/arch/powerpc/include/perf_regs.h +2 -1
index 00e37b106913..1076393e6f43 100644
@@ -62,7 +62,8 @@ static const char *reg_names[] = {
 	[PERF_REG_POWERPC_SOFTE] = "softe",
 	[PERF_REG_POWERPC_TRAP] = "trap",
 	[PERF_REG_POWERPC_DAR] = "dar",
-	[PERF_REG_POWERPC_DSISR] = "dsisr"
+	[PERF_REG_POWERPC_DSISR] = "dsisr",
+	[PERF_REG_POWERPC_SIER] = "sier"
 };
 
 static inline const char *perf_reg_name(int id)
tools/perf/arch/powerpc/util/perf_regs.c +1 -0
index ec50939b0418..07fcd977d93e 100644
@@ -52,6 +52,7 @@ const struct sample_reg sample_reg_masks[] = {
 	SMPL_REG(trap, PERF_REG_POWERPC_TRAP),
 	SMPL_REG(dar, PERF_REG_POWERPC_DAR),
 	SMPL_REG(dsisr, PERF_REG_POWERPC_DSISR),
+	SMPL_REG(sier, PERF_REG_POWERPC_SIER),
 	SMPL_REG_END
 };
 
Signature · 1 line
2.7.4
#1 lore raw
In reply to Madhavan Srinivasan

Hi arnaldo,

Any comments or ack for this patch.

With regards
Maddy

Quoted 84 lines · Madhavan Srinivasan

On each sample, Sample Instruction Event Register (SIER) content is saved in pt_regs. SIER does not have a entry as-is in the pt_regs but instead, SIER content is saved in the "dar" register of pt_regs.

Patch adds another entry to the perf_regs structure to include the "SIER" printing which internally maps to the "dar" of pt_regs.

Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Anju T Sudhakar <[email protected]>
Cc Ravi Bangoria <[email protected]>
---
  arch/powerpc/include/uapi/asm/perf_regs.h       | 1 +
  arch/powerpc/perf/perf_regs.c                   | 1 +
  tools/arch/powerpc/include/uapi/asm/perf_regs.h | 1 +
  tools/perf/arch/powerpc/include/perf_regs.h     | 3 ++-
  tools/perf/arch/powerpc/util/perf_regs.c        | 1 +
  5 files changed, 6 insertions(+), 1 deletion(-)
arch/powerpc/include/uapi/asm/perf_regs.h +1 -0
index 9e52c86ccbd3..ff91192407d1 100644
@@ -46,6 +46,7 @@ enum perf_event_powerpc_regs {
  	PERF_REG_POWERPC_TRAP,
  	PERF_REG_POWERPC_DAR,
  	PERF_REG_POWERPC_DSISR,
+	PERF_REG_POWERPC_SIER,
  	PERF_REG_POWERPC_MAX,
  };
  #endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */
arch/powerpc/perf/perf_regs.c +1 -0
index 09ceea6175ba..c262aea22ad9 100644
@@ -69,6 +69,7 @@ static unsigned int pt_regs_offset[PERF_REG_POWERPC_MAX] = {
  	PT_REGS_OFFSET(PERF_REG_POWERPC_TRAP, trap),
  	PT_REGS_OFFSET(PERF_REG_POWERPC_DAR, dar),
  	PT_REGS_OFFSET(PERF_REG_POWERPC_DSISR, dsisr),
+	PT_REGS_OFFSET(PERF_REG_POWERPC_SIER, dar),
  };
 
  u64 perf_reg_value(struct pt_regs *regs, int idx)
tools/arch/powerpc/include/uapi/asm/perf_regs.h +1 -0
index 9e52c86ccbd3..ff91192407d1 100644
@@ -46,6 +46,7 @@ enum perf_event_powerpc_regs {
  	PERF_REG_POWERPC_TRAP,
  	PERF_REG_POWERPC_DAR,
  	PERF_REG_POWERPC_DSISR,
+	PERF_REG_POWERPC_SIER,
  	PERF_REG_POWERPC_MAX,
  };
  #endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */
tools/perf/arch/powerpc/include/perf_regs.h +2 -1
index 00e37b106913..1076393e6f43 100644
@@ -62,7 +62,8 @@ static const char *reg_names[] = {
  	[PERF_REG_POWERPC_SOFTE] = "softe",
  	[PERF_REG_POWERPC_TRAP] = "trap",
  	[PERF_REG_POWERPC_DAR] = "dar",
-	[PERF_REG_POWERPC_DSISR] = "dsisr"
+	[PERF_REG_POWERPC_DSISR] = "dsisr",
+	[PERF_REG_POWERPC_SIER] = "sier"
  };
 
  static inline const char *perf_reg_name(int id)
tools/perf/arch/powerpc/util/perf_regs.c +1 -0
index ec50939b0418..07fcd977d93e 100644
@@ -52,6 +52,7 @@ const struct sample_reg sample_reg_masks[] = {
  	SMPL_REG(trap, PERF_REG_POWERPC_TRAP),
  	SMPL_REG(dar, PERF_REG_POWERPC_DAR),
  	SMPL_REG(dsisr, PERF_REG_POWERPC_DSISR),
+	SMPL_REG(sier, PERF_REG_POWERPC_SIER),
  	SMPL_REG_END
  };