Skip to content

Commit 685b64e

Browse files
nashuiliangrostedt
authored andcommitted
tracing/osnoise: Use built-in RCU list checking
list_for_each_entry_rcu() has built-in RCU and lock checking. Pass cond argument to list_for_each_entry_rcu() to silence false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled. Execute as follow: [tracing]# echo osnoise > current_tracer [tracing]# echo 1 > tracing_on [tracing]# echo 0 > tracing_on The trace_types_lock is held when osnoise_tracer_stop() or timerlat_tracer_stop() are called in the non-RCU read side section. So, pass lockdep_is_held(&trace_types_lock) to silence false lockdep warning. Link: https://lkml.kernel.org/r/[email protected] Cc: Masami Hiramatsu <[email protected]> Fixes: dae1813 ("tracing/osnoise: Support a list of trace_array *tr") Acked-by: Daniel Bristot de Oliveira <[email protected]> Signed-off-by: Chuang Wang <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent ac28d0a commit 685b64e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

kernel/trace/trace_osnoise.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,8 @@ static void osnoise_unregister_instance(struct trace_array *tr)
147147
* register/unregister serialization is provided by trace's
148148
* trace_types_lock.
149149
*/
150-
lockdep_assert_held(&trace_types_lock);
151-
152-
list_for_each_entry_rcu(inst, &osnoise_instances, list) {
150+
list_for_each_entry_rcu(inst, &osnoise_instances, list,
151+
lockdep_is_held(&trace_types_lock)) {
153152
if (inst->tr == tr) {
154153
list_del_rcu(&inst->list);
155154
found = 1;

0 commit comments

Comments
 (0)