Commit 24a53652 authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Ingo Molnar

tracing: Drop the tr check from the graph tracing path

Each time we save a function entry from the function graph
tracer, we check if the trace array is set, which is wasteful
because it is set anyway before we start the tracer. All we need
is to ensure we have good read and write orderings. When we set
the trace array, we just need to guarantee it to be visible
before starting tracing.
Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
LKML-Reference: <1263453795-7496-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent d931369b
...@@ -212,9 +212,6 @@ int trace_graph_entry(struct ftrace_graph_ent *trace) ...@@ -212,9 +212,6 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
int cpu; int cpu;
int pc; int pc;
if (unlikely(!tr))
return 0;
if (!ftrace_trace_task(current)) if (!ftrace_trace_task(current))
return 0; return 0;
...@@ -287,11 +284,20 @@ void trace_graph_return(struct ftrace_graph_ret *trace) ...@@ -287,11 +284,20 @@ void trace_graph_return(struct ftrace_graph_ret *trace)
local_irq_restore(flags); local_irq_restore(flags);
} }
void set_graph_array(struct trace_array *tr)
{
graph_array = tr;
/* Make graph_array visible before we start tracing */
smp_mb();
}
static int graph_trace_init(struct trace_array *tr) static int graph_trace_init(struct trace_array *tr)
{ {
int ret; int ret;
graph_array = tr; set_graph_array(tr);
ret = register_ftrace_graph(&trace_graph_return, ret = register_ftrace_graph(&trace_graph_return,
&trace_graph_entry); &trace_graph_entry);
if (ret) if (ret)
...@@ -301,11 +307,6 @@ static int graph_trace_init(struct trace_array *tr) ...@@ -301,11 +307,6 @@ static int graph_trace_init(struct trace_array *tr)
return 0; return 0;
} }
void set_graph_array(struct trace_array *tr)
{
graph_array = tr;
}
static void graph_trace_reset(struct trace_array *tr) static void graph_trace_reset(struct trace_array *tr)
{ {
tracing_stop_cmdline_record(); tracing_stop_cmdline_record();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment