Skip to content

Commit

Permalink
tracing: Add rcu dereference annotation for filter->prog
Browse files Browse the repository at this point in the history
ftrace_function_set_filter() referenences filter->prog without annotation
and sparse complains about it. It needs a rcu_dereference_protected()
wrapper.

Reported-by: kbuild test robot <[email protected]>
Fixes: 8076559 ("tracing: Rewrite filter logic to be simpler and faster")
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
rostedt committed Apr 6, 2018
1 parent 5125eee commit 1f3b0fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/trace/trace_events_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,8 @@ static bool is_or(struct prog_entry *prog, int i)
static int ftrace_function_set_filter(struct perf_event *event,
struct event_filter *filter)
{
struct prog_entry *prog = filter->prog;
struct prog_entry *prog = rcu_dereference_protected(filter->prog,
lockdep_is_held(&event_mutex));
struct function_filter_data data = {
.first_filter = 1,
.first_notrace = 1,
Expand Down

0 comments on commit 1f3b0fa

Please sign in to comment.