Skip to content

Commit fb9f5ee

Browse files
committed
tracing: Do not synchronize freeing of trigger filter on boot up
If a trigger filter on the kernel command line fails to apply (due to syntax error), it will be freed. The freeing will call tracepoint_synchronize_unregister(), but this is not needed during early boot up, and will even trigger a lockdep splat. Avoid calling the synchronization function when system_state is SYSTEM_BOOTING. Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Cc: Andrew Morton <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent fab89a0 commit fb9f5ee

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

kernel/trace/trace_events_trigger.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,8 +1085,14 @@ int set_trigger_filter(char *filter_str,
10851085
rcu_assign_pointer(data->filter, filter);
10861086

10871087
if (tmp) {
1088-
/* Make sure the call is done with the filter */
1089-
tracepoint_synchronize_unregister();
1088+
/*
1089+
* Make sure the call is done with the filter.
1090+
* It is possible that a filter could fail at boot up,
1091+
* and then this path will be called. Avoid the synchronization
1092+
* in that case.
1093+
*/
1094+
if (system_state != SYSTEM_BOOTING)
1095+
tracepoint_synchronize_unregister();
10901096
free_event_filter(tmp);
10911097
}
10921098

0 commit comments

Comments
 (0)