Skip to content

Commit

Permalink
tracing: Add preempt disable for filter self test
Browse files Browse the repository at this point in the history
The self testing for event filters does not really need preemption
disabled as there are no races at the time of testing, but the functions
it calls uses rcu_dereference_sched() which will complain if preemption
is not disabled.

Cc: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Aug 30, 2011
1 parent 1d0e78e commit 86b6ef2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kernel/trace/trace_events_filter.c
Original file line number Diff line number Diff line change
@@ -2101,13 +2101,19 @@ static __init int ftrace_test_event_filter(void)
break;
}

/*
* The preemption disabling is not really needed for self
* tests, but the rcu dereference will complain without it.
*/
preempt_disable();
if (*d->not_visited)
walk_pred_tree(filter->preds, filter->root,
test_walk_pred_cb,
d->not_visited);

test_pred_visited = 0;
err = filter_match_preds(filter, &d->rec);
preempt_enable();

__free_filter(filter);

0 comments on commit 86b6ef2

Please sign in to comment.