diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-02-07 15:52:59 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-09 04:56:53 -0500 |
commit | b5db03c4355e568f1567758287b30a6a262d5057 (patch) | |
tree | efdeb3041099a6946e2c5104aadfb78bcdf5a76e /kernel/trace/trace.c | |
parent | 3861a17bcc0af815f684c6178bc9ec2d790c350e (diff) |
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 <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 03fbd4c20bc2..93040f1bef13 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -559,6 +559,15 @@ void unregister_tracer(struct tracer *type) | |||
559 | 559 | ||
560 | found: | 560 | found: |
561 | *t = (*t)->next; | 561 | *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 | |||
562 | if (strlen(type->name) != max_tracer_type_len) | 571 | if (strlen(type->name) != max_tracer_type_len) |
563 | goto out; | 572 | goto out; |
564 | 573 | ||