summaryrefslogtreecommitdiffstats
path: root/kernel/events
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2011-11-21 20:58:59 +0100
committerIngo Molnar <mingo@elte.hu>2011-12-21 11:01:09 +0100
commit365a4038486b57bb2bd516706a80f82f250f5306 (patch)
treee1c435230121dd794e706509e3140584ecfb0ac8 /kernel/events
parentperf, arch: Rework perf_event_index() (diff)
downloadlinux-365a4038486b57bb2bd516706a80f82f250f5306.tar.xz
linux-365a4038486b57bb2bd516706a80f82f250f5306.zip
perf: Fix mmap_page::offset computation
There's multiple reason the counter might be unavailable, change the condition to !->index since perf_event_index() should return 0 for all those cases. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/n/tip-1ixr3olci40w8rgv2evv2ldh@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/events')
-rw-r--r--kernel/events/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 3894309c41a2..05affc3878ff 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3268,7 +3268,7 @@ void perf_event_update_userpage(struct perf_event *event)
barrier();
userpg->index = perf_event_index(event);
userpg->offset = perf_event_count(event);
- if (event->state == PERF_EVENT_STATE_ACTIVE)
+ if (userpg->index)
userpg->offset -= local64_read(&event->hw.prev_count);
userpg->time_enabled = enabled +