tracing: Convert tracer->enabled to counter
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Tue, 14 Jan 2014 13:52:35 +0000 (08:52 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Thu, 20 Feb 2014 17:13:17 +0000 (12:13 -0500)
As tracers will soon be used by instances, the tracer enabled field
needs to be converted to a counter instead of a boolean.
This counter is protected by the trace_types_lock mutex.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c
kernel/trace/trace.h

index 7d5913bb46e86fc64fea7b2377bfe7997a887500..f9f22c4350366f51cb93fad47e30fd38f39db5e0 100644 (file)
@@ -3916,7 +3916,7 @@ static void tracing_set_nop(struct trace_array *tr)
        if (tr->current_trace == &nop_trace)
                return;
        
-       tr->current_trace->enabled = false;
+       tr->current_trace->enabled--;
 
        if (tr->current_trace->reset)
                tr->current_trace->reset(tr);
@@ -3962,7 +3962,7 @@ static int tracing_set_tracer(struct trace_array *tr, const char *buf)
 
        trace_branch_disable();
 
-       tr->current_trace->enabled = false;
+       tr->current_trace->enabled--;
 
        if (tr->current_trace->reset)
                tr->current_trace->reset(tr);
@@ -4006,7 +4006,7 @@ static int tracing_set_tracer(struct trace_array *tr, const char *buf)
        }
 
        tr->current_trace = t;
-       tr->current_trace->enabled = true;
+       tr->current_trace->enabled++;
        trace_branch_enable(tr);
  out:
        mutex_unlock(&trace_types_lock);
index ea51bb2004d2317a56f9ce6eee1784b03452dc44..86915b220bbeffa078df110a2d6d2472600a6208 100644 (file)
@@ -362,8 +362,8 @@ struct tracer {
                                                u32 mask, int set);
        struct tracer           *next;
        struct tracer_flags     *flags;
+       int                     enabled;
        bool                    print_max;
-       bool                    enabled;
        bool                    allow_instances;
 #ifdef CONFIG_TRACER_MAX_TRACE
        bool                    use_max_tr;