aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_functions_graph.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2010-01-14 02:23:15 -0500
committerIngo Molnar <mingo@elte.hu>2010-01-17 02:06:25 -0500
commit24a53652e361321b09df5040711e69387344ce09 (patch)
tree9db320478f5233ee4b427292cc57ad4b3a66fefb /kernel/trace/trace_functions_graph.c
parentd931369b74b3d6f2044f595af6f3dd074f65d9cf (diff)
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: Frederic Weisbecker <fweisbec@gmail.com> Acked-by: Steven 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: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace_functions_graph.c')
-rw-r--r--kernel/trace/trace_functions_graph.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index b1342c5d37cf..f2252296607c 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -212,9 +212,6 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
212 int cpu; 212 int cpu;
213 int pc; 213 int pc;
214 214
215 if (unlikely(!tr))
216 return 0;
217
218 if (!ftrace_trace_task(current)) 215 if (!ftrace_trace_task(current))
219 return 0; 216 return 0;
220 217
@@ -287,11 +284,20 @@ void trace_graph_return(struct ftrace_graph_ret *trace)
287 local_irq_restore(flags); 284 local_irq_restore(flags);
288} 285}
289 286
287void set_graph_array(struct trace_array *tr)
288{
289 graph_array = tr;
290
291 /* Make graph_array visible before we start tracing */
292
293 smp_mb();
294}
295
290static int graph_trace_init(struct trace_array *tr) 296static int graph_trace_init(struct trace_array *tr)
291{ 297{
292 int ret; 298 int ret;
293 299
294 graph_array = tr; 300 set_graph_array(tr);
295 ret = register_ftrace_graph(&trace_graph_return, 301 ret = register_ftrace_graph(&trace_graph_return,
296 &trace_graph_entry); 302 &trace_graph_entry);
297 if (ret) 303 if (ret)
@@ -301,11 +307,6 @@ static int graph_trace_init(struct trace_array *tr)
301 return 0; 307 return 0;
302} 308}
303 309
304void set_graph_array(struct trace_array *tr)
305{
306 graph_array = tr;
307}
308
309static void graph_trace_reset(struct trace_array *tr) 310static void graph_trace_reset(struct trace_array *tr)
310{ 311{
311 tracing_stop_cmdline_record(); 312 tracing_stop_cmdline_record();