[PATCH v3 06/23] perf: Redirect output from inherited events to parents

Alexander Shishkin
2014-08-11T05:29:17Z

In order to collect AUX data from an inherited event, we can redirect its
output to parent's ring buffer if possible (they must be cpu affine). This
patch adds set_output() to the inheritance path.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
kernel/events/core.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 361a45eee2..55cd524564 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7859,6 +7859,12 @@ inherit_event(struct perf_event *parent_event,
= parent_event->overflow_handler_context;

/*
+ * Direct child's output to parent's ring buffer (if any)
+ */
+ if (parent_event->cpu != -1)
+ (void)perf_event_set_output(child_event, parent_event);
+
+ /*
* Precalculate sample_data sizes
*/
perf_event__header_size(child_event);
--
2.1.0.rc1