Skip to content

Commit 0c82378

Browse files
athira-rajeevgregkh
authored andcommitted
powerpc/perf: Exclude pmc5/6 from the irrelevant PMU group constraints
[ Upstream commit 3b6c3ad ] PMU counter support functions enforces event constraints for group of events to check if all events in a group can be monitored. Incase of event codes using PMC5 and PMC6 ( 500fa and 600f4 respectively ), not all constraints are applicable, say the threshold or sample bits. But current code includes pmc5 and pmc6 in some group constraints (like IC_DC Qualifier bits) which is actually not applicable and hence results in those events not getting counted when scheduled along with group of other events. Patch fixes this by excluding PMC5/6 from constraints which are not relevant for it. Fixes: 7ffd948 ("powerpc/perf: factor out power8 pmu functions") Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Reviewed-by: Madhavan Srinivasan <maddy@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/1600672204-1610-1-git-send-email-atrajeev@linux.vnet.ibm.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 65ac955 commit 0c82378

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

arch/powerpc/perf/isa207-common.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,15 @@ int isa207_get_constraint(u64 event, unsigned long *maskp, unsigned long *valp)
288288

289289
mask |= CNST_PMC_MASK(pmc);
290290
value |= CNST_PMC_VAL(pmc);
291+
292+
/*
293+
* PMC5 and PMC6 are used to count cycles and instructions and
294+
* they do not support most of the constraint bits. Add a check
295+
* to exclude PMC5/6 from most of the constraints except for
296+
* EBB/BHRB.
297+
*/
298+
if (pmc >= 5)
299+
goto ebb_bhrb;
291300
}
292301

293302
if (pmc <= 4) {
@@ -357,6 +366,7 @@ int isa207_get_constraint(u64 event, unsigned long *maskp, unsigned long *valp)
357366
}
358367
}
359368

369+
ebb_bhrb:
360370
if (!pmc && ebb)
361371
/* EBB events must specify the PMC */
362372
return -1;

0 commit comments

Comments
 (0)