diff options
Diffstat (limited to 'kernel/trace/trace_functions.c')
| -rw-r--r-- | kernel/trace/trace_functions.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c index c9a0b7df44f..5b01b94518f 100644 --- a/kernel/trace/trace_functions.c +++ b/kernel/trace/trace_functions.c | |||
| @@ -193,9 +193,11 @@ static void tracing_start_function_trace(void) | |||
| 193 | static void tracing_stop_function_trace(void) | 193 | static void tracing_stop_function_trace(void) |
| 194 | { | 194 | { |
| 195 | ftrace_function_enabled = 0; | 195 | ftrace_function_enabled = 0; |
| 196 | /* OK if they are not registered */ | 196 | |
| 197 | unregister_ftrace_function(&trace_stack_ops); | 197 | if (func_flags.val & TRACE_FUNC_OPT_STACK) |
| 198 | unregister_ftrace_function(&trace_ops); | 198 | unregister_ftrace_function(&trace_stack_ops); |
| 199 | else | ||
| 200 | unregister_ftrace_function(&trace_ops); | ||
| 199 | } | 201 | } |
| 200 | 202 | ||
| 201 | static int func_set_flag(u32 old_flags, u32 bit, int set) | 203 | static int func_set_flag(u32 old_flags, u32 bit, int set) |
| @@ -286,11 +288,9 @@ static int | |||
| 286 | ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, | 288 | ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, |
| 287 | struct ftrace_probe_ops *ops, void *data) | 289 | struct ftrace_probe_ops *ops, void *data) |
| 288 | { | 290 | { |
| 289 | char str[KSYM_SYMBOL_LEN]; | ||
| 290 | long count = (long)data; | 291 | long count = (long)data; |
| 291 | 292 | ||
| 292 | kallsyms_lookup(ip, NULL, NULL, NULL, str); | 293 | seq_printf(m, "%pf:", (void *)ip); |
| 293 | seq_printf(m, "%s:", str); | ||
| 294 | 294 | ||
| 295 | if (ops == &traceon_probe_ops) | 295 | if (ops == &traceon_probe_ops) |
| 296 | seq_printf(m, "traceon"); | 296 | seq_printf(m, "traceon"); |
| @@ -300,8 +300,7 @@ ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, | |||
| 300 | if (count == -1) | 300 | if (count == -1) |
| 301 | seq_printf(m, ":unlimited\n"); | 301 | seq_printf(m, ":unlimited\n"); |
| 302 | else | 302 | else |
| 303 | seq_printf(m, ":count=%ld", count); | 303 | seq_printf(m, ":count=%ld\n", count); |
| 304 | seq_putc(m, '\n'); | ||
| 305 | 304 | ||
| 306 | return 0; | 305 | return 0; |
| 307 | } | 306 | } |
| @@ -362,7 +361,7 @@ ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable) | |||
| 362 | out_reg: | 361 | out_reg: |
| 363 | ret = register_ftrace_function_probe(glob, ops, count); | 362 | ret = register_ftrace_function_probe(glob, ops, count); |
| 364 | 363 | ||
| 365 | return ret; | 364 | return ret < 0 ? ret : 0; |
| 366 | } | 365 | } |
| 367 | 366 | ||
| 368 | static struct ftrace_func_command ftrace_traceon_cmd = { | 367 | static struct ftrace_func_command ftrace_traceon_cmd = { |
