tracing: Add rcu annotation around file->filter accesses
Steven Rostedt
maintainerPATCH 1/1 tracing: Add rcu annotation around file->filter accesses
From: Steven Rostedt <[email protected]>
Running sparse on trace_events_filter.c triggered several warnings about file->filter being accessed directly even though it's annotated with __rcu.
Add rcu_dereference() around it and shuffle the logic slightly so that it's always referenced via accessor functions.
Signed-off-by Steven Rostedt (Google) <[email protected]>
--- kernel/trace/trace_events_filter.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
kernel/trace/trace_events_filter.c +6 -4
@@ -1250,7 +1250,9 @@ static void append_filter_err(struct trace_array *tr,static inline struct event_filter *event_filter (struct trace_event_file *file) { -return file->filter; +return rcu_dereference_protected (file->filter, +lockdep_is_held (&event_mutex)); + }/* caller must hold event_mutex */
@@ -1320,7 +1322,7 @@ void free_event_filter(struct event_filter *filter)static inline void __remove_filter (struct trace_event_file *file) {filter_disable (file); -remove_filter_string (file->filter); +remove_filter_string (event_filter (file)); } static void filter_free_subsystem_preds(struct trace_subsystem_dir *dir,
@@ -1405,7 +1407,7 @@ static void try_delay_free_filter(struct event_filter *filter)static inline void __free_subsystem_filter (struct trace_event_file *file) { -__free_filter (file->filter); +__free_filter (event_filter (file)); file->filter =NULL ; }
@@ -1465,7 +1467,7 @@ static void filter_free_subsystem_filters(struct trace_subsystem_dir *dir,list_for_each_entry (file, &tr->events, list) {if (file->system != dir || !file->filter)continue ; -__free_filter (file->filter); +__free_subsystem_filter (file); }__free_filter (filter); }
Signature · 1 line
2.47.2