File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ enum perf_event_powerpc_regs {
52
52
PERF_REG_POWERPC_MMCR0 ,
53
53
PERF_REG_POWERPC_MMCR1 ,
54
54
PERF_REG_POWERPC_MMCR2 ,
55
+ PERF_REG_POWERPC_MMCR3 ,
56
+ PERF_REG_POWERPC_SIER2 ,
57
+ PERF_REG_POWERPC_SIER3 ,
55
58
/* Max regs without the extended regs */
56
59
PERF_REG_POWERPC_MAX = PERF_REG_POWERPC_MMCRA + 1 ,
57
60
};
@@ -60,6 +63,9 @@ enum perf_event_powerpc_regs {
60
63
61
64
/* PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_300 */
62
65
#define PERF_REG_PMU_MASK_300 (((1ULL << (PERF_REG_POWERPC_MMCR2 + 1)) - 1) - PERF_REG_PMU_MASK)
66
+ /* PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_31 */
67
+ #define PERF_REG_PMU_MASK_31 (((1ULL << (PERF_REG_POWERPC_SIER3 + 1)) - 1) - PERF_REG_PMU_MASK)
63
68
64
69
#define PERF_REG_MAX_ISA_300 (PERF_REG_POWERPC_MMCR2 + 1)
70
+ #define PERF_REG_MAX_ISA_31 (PERF_REG_POWERPC_SIER3 + 1)
65
71
#endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */
Original file line number Diff line number Diff line change @@ -81,6 +81,14 @@ static u64 get_ext_regs_value(int idx)
81
81
return mfspr (SPRN_MMCR1 );
82
82
case PERF_REG_POWERPC_MMCR2 :
83
83
return mfspr (SPRN_MMCR2 );
84
+ #ifdef CONFIG_PPC64
85
+ case PERF_REG_POWERPC_MMCR3 :
86
+ return mfspr (SPRN_MMCR3 );
87
+ case PERF_REG_POWERPC_SIER2 :
88
+ return mfspr (SPRN_SIER2 );
89
+ case PERF_REG_POWERPC_SIER3 :
90
+ return mfspr (SPRN_SIER3 );
91
+ #endif
84
92
default : return 0 ;
85
93
}
86
94
}
@@ -89,7 +97,9 @@ u64 perf_reg_value(struct pt_regs *regs, int idx)
89
97
{
90
98
u64 perf_reg_extended_max = PERF_REG_POWERPC_MAX ;
91
99
92
- if (cpu_has_feature (CPU_FTR_ARCH_300 ))
100
+ if (cpu_has_feature (CPU_FTR_ARCH_31 ))
101
+ perf_reg_extended_max = PERF_REG_MAX_ISA_31 ;
102
+ else if (cpu_has_feature (CPU_FTR_ARCH_300 ))
93
103
perf_reg_extended_max = PERF_REG_MAX_ISA_300 ;
94
104
95
105
if (idx == PERF_REG_POWERPC_SIER &&
Original file line number Diff line number Diff line change 87
87
#define POWER10_MMCRA_IFM3 0x00000000C0000000UL
88
88
#define POWER10_MMCRA_BHRB_MASK 0x00000000C0000000UL
89
89
90
+ extern u64 PERF_REG_EXTENDED_MASK ;
91
+
90
92
/* Table of alternatives, sorted by column 0 */
91
93
static const unsigned int power10_event_alternatives [][MAX_ALT ] = {
92
94
{ PM_RUN_CYC_ALT , PM_RUN_CYC },
@@ -397,6 +399,7 @@ static struct power_pmu power10_pmu = {
397
399
.cache_events = & power10_cache_events ,
398
400
.attr_groups = power10_pmu_attr_groups ,
399
401
.bhrb_nr = 32 ,
402
+ .capabilities = PERF_PMU_CAP_EXTENDED_REGS ,
400
403
};
401
404
402
405
int init_power10_pmu (void )
@@ -408,6 +411,9 @@ int init_power10_pmu(void)
408
411
strcmp (cur_cpu_spec -> oprofile_cpu_type , "ppc64/power10" ))
409
412
return - ENODEV ;
410
413
414
+ /* Set the PERF_REG_EXTENDED_MASK here */
415
+ PERF_REG_EXTENDED_MASK = PERF_REG_PMU_MASK_31 ;
416
+
411
417
rc = register_power_pmu (& power10_pmu );
412
418
if (rc )
413
419
return rc ;
You can’t perform that action at this time.
0 commit comments