diff options
author | Peter Zijlstra <peterz@infradead.org> | 2015-11-02 04:50:51 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-11-09 10:13:11 -0500 |
commit | b71b437eedaed985062492565d9d421d975ae845 (patch) | |
tree | 73effac96ff3049417243bb4b459e44c239b6ce2 | |
parent | 2fd59077755c44dbbd9b2fa89cf988235a3a6a2b (diff) |
perf: Fix inherited events vs. tracepoint filters
Arnaldo reported that tracepoint filters seem to misbehave (ie. not
apply) on inherited events.
The fix is obvious; filters are only set on the actual (parent)
event, use the normal pattern of using this parent event for filters.
This is safe because each child event has a reference to it.
Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20151102095051.GN17308@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | kernel/events/core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index f8e5c443d74e..98a4b9db7f37 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -6909,6 +6909,10 @@ static int perf_tp_filter_match(struct perf_event *event, | |||
6909 | { | 6909 | { |
6910 | void *record = data->raw->data; | 6910 | void *record = data->raw->data; |
6911 | 6911 | ||
6912 | /* only top level events have filters set */ | ||
6913 | if (event->parent) | ||
6914 | event = event->parent; | ||
6915 | |||
6912 | if (likely(!event->filter) || filter_match_preds(event->filter, record)) | 6916 | if (likely(!event->filter) || filter_match_preds(event->filter, record)) |
6913 | return 1; | 6917 | return 1; |
6914 | return 0; | 6918 | return 0; |