]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/perf: power_pmu_start restores incorrect values, breaking frequency events
authorAnton Blanchard <anton@samba.org>
Wed, 15 Feb 2012 18:48:22 +0000 (18:48 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 16 Feb 2012 05:24:35 +0000 (16:24 +1100)
commit3e52799f674f828297dd6521213bc3f8a25a1984
tree8ff43b5fd98ab68352dc4dd0823401a5736afab2
parent734033e5cd7b47bb560a4d10e86a91b329f4a90e
powerpc/perf: power_pmu_start restores incorrect values, breaking frequency events

perf on POWER stopped working after commit 69d4ae31ff05 (perf: Fix
broken interrupt rate throttling). That patch exposed a bug in
the POWER perf_events code.

Since the PMCs count upwards and take an exception when the top bit
is set, we want to write 0x80000000 - left in power_pmu_start. We were
instead programming in left which effectively disables the counter
until we eventually hit 0x80000000. This could take seconds or longer.

With the patch applied I get the expected number of samples:

          SAMPLE events:       9948

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: <stable@kernel.org>
arch/powerpc/kernel/perf_event.c