diff options
Diffstat (limited to 'kernel/trace/trace_functions.c')
| -rw-r--r-- | kernel/trace/trace_functions.c | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c index 0f85a64003d3..9236d7e25a16 100644 --- a/kernel/trace/trace_functions.c +++ b/kernel/trace/trace_functions.c | |||
| @@ -16,20 +16,10 @@ | |||
| 16 | 16 | ||
| 17 | #include "trace.h" | 17 | #include "trace.h" |
| 18 | 18 | ||
| 19 | static void function_reset(struct trace_array *tr) | ||
| 20 | { | ||
| 21 | int cpu; | ||
| 22 | |||
| 23 | tr->time_start = ftrace_now(tr->cpu); | ||
| 24 | |||
| 25 | for_each_online_cpu(cpu) | ||
| 26 | tracing_reset(tr, cpu); | ||
| 27 | } | ||
| 28 | |||
| 29 | static void start_function_trace(struct trace_array *tr) | 19 | static void start_function_trace(struct trace_array *tr) |
| 30 | { | 20 | { |
| 31 | tr->cpu = get_cpu(); | 21 | tr->cpu = get_cpu(); |
| 32 | function_reset(tr); | 22 | tracing_reset_online_cpus(tr); |
| 33 | put_cpu(); | 23 | put_cpu(); |
| 34 | 24 | ||
| 35 | tracing_start_cmdline_record(); | 25 | tracing_start_cmdline_record(); |
| @@ -42,24 +32,20 @@ static void stop_function_trace(struct trace_array *tr) | |||
| 42 | tracing_stop_cmdline_record(); | 32 | tracing_stop_cmdline_record(); |
| 43 | } | 33 | } |
| 44 | 34 | ||
| 45 | static void function_trace_init(struct trace_array *tr) | 35 | static int function_trace_init(struct trace_array *tr) |
| 46 | { | 36 | { |
| 47 | if (tr->ctrl) | 37 | start_function_trace(tr); |
| 48 | start_function_trace(tr); | 38 | return 0; |
| 49 | } | 39 | } |
| 50 | 40 | ||
| 51 | static void function_trace_reset(struct trace_array *tr) | 41 | static void function_trace_reset(struct trace_array *tr) |
| 52 | { | 42 | { |
| 53 | if (tr->ctrl) | 43 | stop_function_trace(tr); |
| 54 | stop_function_trace(tr); | ||
| 55 | } | 44 | } |
| 56 | 45 | ||
| 57 | static void function_trace_ctrl_update(struct trace_array *tr) | 46 | static void function_trace_start(struct trace_array *tr) |
| 58 | { | 47 | { |
| 59 | if (tr->ctrl) | 48 | tracing_reset_online_cpus(tr); |
| 60 | start_function_trace(tr); | ||
| 61 | else | ||
| 62 | stop_function_trace(tr); | ||
| 63 | } | 49 | } |
| 64 | 50 | ||
| 65 | static struct tracer function_trace __read_mostly = | 51 | static struct tracer function_trace __read_mostly = |
| @@ -67,7 +53,7 @@ static struct tracer function_trace __read_mostly = | |||
| 67 | .name = "function", | 53 | .name = "function", |
| 68 | .init = function_trace_init, | 54 | .init = function_trace_init, |
| 69 | .reset = function_trace_reset, | 55 | .reset = function_trace_reset, |
| 70 | .ctrl_update = function_trace_ctrl_update, | 56 | .start = function_trace_start, |
| 71 | #ifdef CONFIG_FTRACE_SELFTEST | 57 | #ifdef CONFIG_FTRACE_SELFTEST |
| 72 | .selftest = trace_selftest_startup_function, | 58 | .selftest = trace_selftest_startup_function, |
| 73 | #endif | 59 | #endif |
