ARM: 6989/1: perf: do not start the PMU when no events are present
commitd00726a966330f798b9cb055611be5d11547dbdd
authorWill Deacon <will.deacon@arm.com>
Fri, 1 Jul 2011 13:38:12 +0000 (1 14:38 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 3 Aug 2011 19:42:27 +0000 (3 12:42 -0700)
treebbefc68b1ff1114c114e7c5a16b29457b2248e6d
parentf26417930bc1b60ffd1a0ffc11e4a86a48e9d9bc
ARM: 6989/1: perf: do not start the PMU when no events are present

commit f4f38430c94c38187db73a2cf3892cc8b12a2713 upstream.

armpmu_enable can be called in situations where no events are present
(for example, from the event rotation tick after a profiled task has
exited). In this case, we currently start the PMU anyway which may
leave it active inevitably without any events being monitored.

This patch adds a simple check to the enabling code so that we avoid
starting the PMU when no events are present.

Reported-by: Ashwin Chaugle <ashwinc@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/arm/kernel/perf_event.c