Skip to content

Commit 64acab4

Browse files
Madhavan Srinivasanmpe
authored andcommitted
powerpc/perf: Add blacklisted events for Power9 DD2.1
These events either do not count, or do not count correctly, so to prevent user confusion block counting them at all. Signed-off-by: Madhavan Srinivasan <[email protected]> [mpe: Change log] Signed-off-by: Michael Ellerman <[email protected]>
1 parent b58064d commit 64acab4

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

arch/powerpc/perf/power9-events-list.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,16 @@ EVENT(PM_BR_CMPL_ALT, 0x10012)
6969
EVENT(PM_BR_2PATH, 0x20036)
7070
/* ALternate branch event that are not strongly biased */
7171
EVENT(PM_BR_2PATH_ALT, 0x40036)
72+
73+
/* Blacklisted events */
74+
EVENT(PM_MRK_ST_DONE_L2, 0x10134)
75+
EVENT(PM_RADIX_PWC_L1_HIT, 0x1f056)
76+
EVENT(PM_FLOP_CMPL, 0x100f4)
77+
EVENT(PM_MRK_NTF_FIN, 0x20112)
78+
EVENT(PM_RADIX_PWC_L2_HIT, 0x2d024)
79+
EVENT(PM_IFETCH_THROTTLE, 0x3405e)
80+
EVENT(PM_MRK_L2_TM_ST_ABORT_SISTER, 0x3e15c)
81+
EVENT(PM_RADIX_PWC_L3_HIT, 0x3f056)
82+
EVENT(PM_RUN_CYC_SMT2_MODE, 0x3006c)
83+
EVENT(PM_TM_TX_PASS_RUN_INST, 0x4e014)
84+
EVENT(PM_DISP_HELD_SYNC_HOLD, 0x4003c)

arch/powerpc/perf/power9-pmu.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,26 @@ enum {
101101
#define POWER9_MMCRA_IFM2 0x0000000080000000UL
102102
#define POWER9_MMCRA_IFM3 0x00000000C0000000UL
103103

104+
/* Nasty Power9 specific hack */
105+
#define PVR_POWER9_CUMULUS 0x00002000
106+
104107
/* PowerISA v2.07 format attribute structure*/
105108
extern struct attribute_group isa207_pmu_format_group;
106109

110+
int p9_dd21_bl_ev[] = {
111+
PM_MRK_ST_DONE_L2,
112+
PM_RADIX_PWC_L1_HIT,
113+
PM_FLOP_CMPL,
114+
PM_MRK_NTF_FIN,
115+
PM_RADIX_PWC_L2_HIT,
116+
PM_IFETCH_THROTTLE,
117+
PM_MRK_L2_TM_ST_ABORT_SISTER,
118+
PM_RADIX_PWC_L3_HIT,
119+
PM_RUN_CYC_SMT2_MODE,
120+
PM_TM_TX_PASS_RUN_INST,
121+
PM_DISP_HELD_SYNC_HOLD,
122+
};
123+
107124
/* Table of alternatives, sorted by column 0 */
108125
static const unsigned int power9_event_alternatives[][MAX_ALT] = {
109126
{ PM_INST_DISP, PM_INST_DISP_ALT },
@@ -446,12 +463,21 @@ static struct power_pmu power9_pmu = {
446463
static int __init init_power9_pmu(void)
447464
{
448465
int rc = 0;
466+
unsigned int pvr = mfspr(SPRN_PVR);
449467

450468
/* Comes from cpu_specs[] */
451469
if (!cur_cpu_spec->oprofile_cpu_type ||
452470
strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power9"))
453471
return -ENODEV;
454472

473+
/* Blacklist events */
474+
if (!(pvr & PVR_POWER9_CUMULUS)) {
475+
if ((PVR_CFG(pvr) == 2) && (PVR_MIN(pvr) == 1)) {
476+
power9_pmu.blacklist_ev = p9_dd21_bl_ev;
477+
power9_pmu.n_blacklist_ev = ARRAY_SIZE(p9_dd21_bl_ev);
478+
}
479+
}
480+
455481
if (cpu_has_feature(CPU_FTR_POWER9_DD1)) {
456482
/*
457483
* Since PM_INST_CMPL may not provide right counts in all

0 commit comments

Comments
 (0)