tracing: Add preempt disable for filter self test

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>
This commit is contained in:
Steven Rostedt 2011-08-22 09:41:46 -04:00 коммит произвёл Steven Rostedt
Родитель 1d0e78e380
Коммит 86b6ef21b8
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -2101,6 +2101,11 @@ static __init int ftrace_test_event_filter(void)
break; 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) if (*d->not_visited)
walk_pred_tree(filter->preds, filter->root, walk_pred_tree(filter->preds, filter->root,
test_walk_pred_cb, test_walk_pred_cb,
@ -2108,6 +2113,7 @@ static __init int ftrace_test_event_filter(void)
test_pred_visited = 0; test_pred_visited = 0;
err = filter_match_preds(filter, &d->rec); err = filter_match_preds(filter, &d->rec);
preempt_enable();
__free_filter(filter); __free_filter(filter);