Skip to content

Commit

Permalink
tracing: handle unregistering the current tracer
Browse files Browse the repository at this point in the history
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 <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Feb 9, 2009
1 parent 3861a17 commit b5db03c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,15 @@ void unregister_tracer(struct tracer *type)

found:
*t = (*t)->next;

if (type == current_trace && tracer_enabled) {
tracer_enabled = 0;
tracing_stop();
if (current_trace->stop)
current_trace->stop(&global_trace);
current_trace = &nop_trace;
}

if (strlen(type->name) != max_tracer_type_len)
goto out;

Expand Down

0 comments on commit b5db03c

Please sign in to comment.