diff options
Diffstat (limited to 'kernel/trace/trace_functions_graph.c')
-rw-r--r-- | kernel/trace/trace_functions_graph.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index 855c13c61e77..140b4b51ab34 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c | |||
@@ -345,17 +345,25 @@ static void trace_graph_thresh_return(struct ftrace_graph_ret *trace) | |||
345 | trace_graph_return(trace); | 345 | trace_graph_return(trace); |
346 | } | 346 | } |
347 | 347 | ||
348 | static struct fgraph_ops funcgraph_thresh_ops = { | ||
349 | .entryfunc = &trace_graph_entry, | ||
350 | .retfunc = &trace_graph_thresh_return, | ||
351 | }; | ||
352 | |||
353 | static struct fgraph_ops funcgraph_ops = { | ||
354 | .entryfunc = &trace_graph_entry, | ||
355 | .retfunc = &trace_graph_return, | ||
356 | }; | ||
357 | |||
348 | static int graph_trace_init(struct trace_array *tr) | 358 | static int graph_trace_init(struct trace_array *tr) |
349 | { | 359 | { |
350 | int ret; | 360 | int ret; |
351 | 361 | ||
352 | set_graph_array(tr); | 362 | set_graph_array(tr); |
353 | if (tracing_thresh) | 363 | if (tracing_thresh) |
354 | ret = register_ftrace_graph(&trace_graph_thresh_return, | 364 | ret = register_ftrace_graph(&funcgraph_thresh_ops); |
355 | &trace_graph_entry); | ||
356 | else | 365 | else |
357 | ret = register_ftrace_graph(&trace_graph_return, | 366 | ret = register_ftrace_graph(&funcgraph_ops); |
358 | &trace_graph_entry); | ||
359 | if (ret) | 367 | if (ret) |
360 | return ret; | 368 | return ret; |
361 | tracing_start_cmdline_record(); | 369 | tracing_start_cmdline_record(); |
@@ -366,7 +374,10 @@ static int graph_trace_init(struct trace_array *tr) | |||
366 | static void graph_trace_reset(struct trace_array *tr) | 374 | static void graph_trace_reset(struct trace_array *tr) |
367 | { | 375 | { |
368 | tracing_stop_cmdline_record(); | 376 | tracing_stop_cmdline_record(); |
369 | unregister_ftrace_graph(); | 377 | if (tracing_thresh) |
378 | unregister_ftrace_graph(&funcgraph_thresh_ops); | ||
379 | else | ||
380 | unregister_ftrace_graph(&funcgraph_ops); | ||
370 | } | 381 | } |
371 | 382 | ||
372 | static int graph_trace_update_thresh(struct trace_array *tr) | 383 | static int graph_trace_update_thresh(struct trace_array *tr) |