diff options
Diffstat (limited to 'kernel/trace/trace_functions_graph.c')
-rw-r--r-- | kernel/trace/trace_functions_graph.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index b1342c5d37c..f2252296607 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 | ||
287 | void 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 | |||
290 | static int graph_trace_init(struct trace_array *tr) | 296 | static 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 | ||
304 | void set_graph_array(struct trace_array *tr) | ||
305 | { | ||
306 | graph_array = tr; | ||
307 | } | ||
308 | |||
309 | static void graph_trace_reset(struct trace_array *tr) | 310 | static void graph_trace_reset(struct trace_array *tr) |
310 | { | 311 | { |
311 | tracing_stop_cmdline_record(); | 312 | tracing_stop_cmdline_record(); |