Skip to content

Commit b5db03c

Browse files
acmelIngo Molnar
authored andcommitted
tracing: handle unregistering the current tracer
Impact: simplification Instead of requiring that plugins have the sequence: my_tracer_stop(my_trace_array); unregister_tracer(my_tracer); it should be possible just do a: unregister_tracer(my_tracer); Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 3861a17 commit b5db03c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

kernel/trace/trace.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,15 @@ void unregister_tracer(struct tracer *type)
559559

560560
found:
561561
*t = (*t)->next;
562+
563+
if (type == current_trace && tracer_enabled) {
564+
tracer_enabled = 0;
565+
tracing_stop();
566+
if (current_trace->stop)
567+
current_trace->stop(&global_trace);
568+
current_trace = &nop_trace;
569+
}
570+
562571
if (strlen(type->name) != max_tracer_type_len)
563572
goto out;
564573

0 commit comments

Comments
 (0)