aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/perf_event.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-05-21 08:27:58 -0400
committerIngo Molnar <mingo@elte.hu>2010-06-09 05:12:37 -0400
commita6e6dea68c18f705957573ee5596097c7e82d0e5 (patch)
tree2e8d302800fa4c57cc6604d856e6d680d3ee120f /kernel/perf_event.c
parentb5e58793c7a8ec35e72ea6ec6c353499dd189809 (diff)
perf: Add perf_event::child_count
Only child counters adding back their values into the parent counter are responsible for cross-cpu updates to event->count. So if we pull that out into a new child_count variable, we get an event->count that is only modified locally. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Steven Rostedt <rostedt@goodmis.org> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r--kernel/perf_event.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index ab4c0ffc271c..a395fda2d94c 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -1738,7 +1738,7 @@ static void __perf_event_read(void *info)
1738 1738
1739static inline u64 perf_event_count(struct perf_event *event) 1739static inline u64 perf_event_count(struct perf_event *event)
1740{ 1740{
1741 return atomic64_read(&event->count); 1741 return atomic64_read(&event->count) + atomic64_read(&event->child_count);
1742} 1742}
1743 1743
1744static u64 perf_event_read(struct perf_event *event) 1744static u64 perf_event_read(struct perf_event *event)
@@ -5379,7 +5379,7 @@ static void sync_child_event(struct perf_event *child_event,
5379 /* 5379 /*
5380 * Add back the child's count to the parent's count: 5380 * Add back the child's count to the parent's count:
5381 */ 5381 */
5382 atomic64_add(child_val, &parent_event->count); 5382 atomic64_add(child_val, &parent_event->child_count);
5383 atomic64_add(child_event->total_time_enabled, 5383 atomic64_add(child_event->total_time_enabled,
5384 &parent_event->child_total_time_enabled); 5384 &parent_event->child_total_time_enabled);
5385 atomic64_add(child_event->total_time_running, 5385 atomic64_add(child_event->total_time_running,