]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 6989/1: perf: do not start the PMU when no events are present
authorWill Deacon <will.deacon@arm.com>
Fri, 1 Jul 2011 13:38:12 +0000 (14:38 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 5 Jul 2011 11:37:23 +0000 (12:37 +0100)
commite64709ccb56b1cdd53e51e6cce4fd7415875dc48
treee8101e5202bfe600f928f3f2400dfd5afa4b54f6
parent0048c865a8759f827289bd125fa94e293b82f24a
ARM: 6989/1: perf: do not start the PMU when no events are present

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.

Cc: <stable@kernel.org>
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>
arch/arm/kernel/perf_event.c