lkml.org 
[lkml]   [2009]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateMon, 23 Nov 2009 11:37:30 +0100
FromPeter Zijlstra <>
Subject[PATCH 8/8][RFC] perf: be paranoid about child times?
Normally we flatten the inherited hierarchy by attaching all childs to
the top parent, therefore a child's child_total_time_* should never
get incremented, add it anyway?

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
kernel/perf_event.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: linux-2.6/kernel/perf_event.c
===================================================================
--- linux-2.6.orig/kernel/perf_event.c
+++ linux-2.6/kernel/perf_event.c
@@ -1780,8 +1780,10 @@ u64 perf_event_read_value(struct perf_ev

list_for_each_entry(child, &event->child_list, child_list) {
total += perf_event_read(child);
- *enabled += child->total_time_enabled;
- *running += child->total_time_running;
+ *enabled += child->total_time_enabled +
+ atomic64_read(&child->child_total_time_enabled);
+ *running += child->total_time_running +
+ atomic64_read(&child->child_total_time_running);
}
mutex_unlock(&event->child_mutex);

--



\
 
 \ /
  Last update: 2009-11-23 11:45    [from the cache]
©2003-2010