lkml.org 
[lkml]   [2009]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 3/8] perf: disable events when we detach them
If we leave the event in STATE_INACTIVE, any read of the event after
the detach will increase the running count but not the enabled count
and cause funny scaling artefacts.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
kernel/perf_event.c | 2 ++
1 file changed, 2 insertions(+)
Index: linux-2.6/kernel/perf_event.c
===================================================================
--- linux-2.6.orig/kernel/perf_event.c
+++ linux-2.6/kernel/perf_event.c
@@ -294,6 +294,8 @@ list_del_event(struct perf_event *event,
if (event->group_leader != event)
event->group_leader->nr_siblings--;

+ event->state = PERF_EVENT_STATE_OFF;
+
/*
* If this was a group event with sibling events then
* upgrade the siblings to singleton events by adding them
--



\
 
 \ /
  Last update: 2009-11-23 11:45    [W:0.114 / U:0.312 seconds]
©2003-2014 Jasper Spaans. Advertise on this site