]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/perf: Factor out PPMU_ONLY_COUNT_RUN check code from power8
authorMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
Mon, 31 Jul 2017 08:02:41 +0000 (13:32 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 10 Aug 2017 12:30:05 +0000 (22:30 +1000)
commitc4e3bdd2eb2ba3d7e151e73a58dff6ea8951aa3c
treebec697df6634749c98354b8ea851df4063cd6a12
parent5dd4e9264f8cc92364f9de3bf1dd3a042fe64a40
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: 612b8adc528cd ('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>
arch/powerpc/perf/isa207-common.c
arch/powerpc/perf/isa207-common.h
arch/powerpc/perf/power8-pmu.c
arch/powerpc/perf/power9-pmu.c