summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/perf/power9-pmu.c
diff options
context:
space:
mode:
authorMadhavan Srinivasan <maddy@linux.vnet.ibm.com>2017-07-31 13:32:41 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2017-08-10 22:30:05 +1000
commit70a7e720998d5beaf0c8abd945234e065a49336b (patch)
treebec697df6634749c98354b8ea851df4063cd6a12 /arch/powerpc/perf/power9-pmu.c
parent7aa345d84245a75760fc35a385fc5585f5e3336a (diff)
downloadtalos-op-linux-70a7e720998d5beaf0c8abd945234e065a49336b.tar.gz
talos-op-linux-70a7e720998d5beaf0c8abd945234e065a49336b.zip
powerpc/perf: Factor out PPMU_ONLY_COUNT_RUN check code from power8
There are some hardware events on Power systems which only count when the processor is not idle, and there are some fixed-function counters which count such events. For example, the "run cycles" event counts cycles when the processor is not idle. If the user asks to count cycles, we can use "run cycles" if this is a per-task event, since the processor is running when the task is running, by definition. We can't use "run cycles" if the user asks for "cycles" on a system-wide counter. Currently in power8 this check is done using PPMU_ONLY_COUNT_RUN flag in power8_get_alternatives() function. Based on the flag, events are switched if needed. This function should also be enabled in power9, so factor out the code to isa207_get_alternatives(). Fixes: efe881afdd999 ('powerpc/perf: Factor out event_alternative function') Reported-by: Anton Blanchard <anton@samba.org> Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/perf/power9-pmu.c')
-rw-r--r--arch/powerpc/perf/power9-pmu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/perf/power9-pmu.c b/arch/powerpc/perf/power9-pmu.c
index 2280cf87ff9c..d83aa24b77d4 100644
--- a/arch/powerpc/perf/power9-pmu.c
+++ b/arch/powerpc/perf/power9-pmu.c
@@ -115,8 +115,9 @@ static int power9_get_alternatives(u64 event, unsigned int flags, u64 alt[])
{
int num_alt = 0;
- num_alt = isa207_get_alternatives(event, alt, power9_event_alternatives,
- (int)ARRAY_SIZE(power9_event_alternatives));
+ num_alt = isa207_get_alternatives(event, alt,
+ ARRAY_SIZE(power9_event_alternatives), flags,
+ power9_event_alternatives);
return num_alt;
}
OpenPOWER on IntegriCloud