Skip to content

Commit b71b437

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
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 <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: David Ahern <[email protected]> Cc: Frédéric Weisbecker <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Wang Nan <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 2fd5907 commit b71b437

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kernel/events/core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6909,6 +6909,10 @@ static int perf_tp_filter_match(struct perf_event *event,
69096909
{
69106910
void *record = data->raw->data;
69116911

6912+
/* only top level events have filters set */
6913+
if (event->parent)
6914+
event = event->parent;
6915+
69126916
if (likely(!event->filter) || filter_match_preds(event->filter, record))
69136917
return 1;
69146918
return 0;

0 commit comments

Comments
 (0)