Skip to content

Commit

Permalink
tracing: Convert tracer->enabled to counter
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt (Red Hat) committed Feb 20, 2014
1 parent 6b450d2 commit 50512ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 50512ab

Please sign in to comment.