aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/perf_event.c
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2011-04-05 09:01:24 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-04-10 16:13:35 -0400
commit6759788b944139793bffa889761cc3d8d703fdc0 (patch)
treeac97143a319067bb8d5929d83f34df646d703189 /arch/arm/kernel/perf_event.c
parente89c0d7090c54d7b11b9b091e495a1ae345dd3ff (diff)
ARM: 6865/1: perf: ensure pass through zero is counted on overflow
Commit a737823d ("ARM: perf: ensure overflows aren't missed due to IRQ latency") changed the way that event deltas are calculated on overflow so that we don't miss events when the new count value overtakes the previous one. Unfortunately, we forget to count the event that passes through zero so we end up being off by 1. This patch adds on the correction. Reported-by: Chris Moore <moore@free.fr> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/perf_event.c')
-rw-r--r--arch/arm/kernel/perf_event.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 69cfee0fe00f..979da3947f42 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -221,7 +221,7 @@ again:
221 prev_raw_count &= armpmu->max_period; 221 prev_raw_count &= armpmu->max_period;
222 222
223 if (overflow) 223 if (overflow)
224 delta = armpmu->max_period - prev_raw_count + new_raw_count; 224 delta = armpmu->max_period - prev_raw_count + new_raw_count + 1;
225 else 225 else
226 delta = new_raw_count - prev_raw_count; 226 delta = new_raw_count - prev_raw_count;
227 227