aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/perf_event.h1
-rw-r--r--kernel/perf_event.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 441992a9775c..f34dab9b275e 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -671,6 +671,7 @@ struct perf_event {
671 enum perf_event_active_state state; 671 enum perf_event_active_state state;
672 unsigned int attach_state; 672 unsigned int attach_state;
673 atomic64_t count; 673 atomic64_t count;
674 atomic64_t child_count;
674 675
675 /* 676 /*
676 * These are the total time in nanoseconds that the event 677 * These are the total time in nanoseconds that the event
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,