diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/trace/ftrace.c | 14 | ||||
| -rw-r--r-- | kernel/trace/trace.c | 5 |
2 files changed, 9 insertions, 10 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 6893d5a2bf08..926ebfb74936 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
| @@ -66,7 +66,7 @@ | |||
| 66 | 66 | ||
| 67 | static struct ftrace_ops ftrace_list_end __read_mostly = { | 67 | static struct ftrace_ops ftrace_list_end __read_mostly = { |
| 68 | .func = ftrace_stub, | 68 | .func = ftrace_stub, |
| 69 | .flags = FTRACE_OPS_FL_RECURSION_SAFE, | 69 | .flags = FTRACE_OPS_FL_RECURSION_SAFE | FTRACE_OPS_FL_STUB, |
| 70 | }; | 70 | }; |
| 71 | 71 | ||
| 72 | /* ftrace_enabled is a method to turn ftrace on or off */ | 72 | /* ftrace_enabled is a method to turn ftrace on or off */ |
| @@ -694,7 +694,6 @@ int ftrace_profile_pages_init(struct ftrace_profile_stat *stat) | |||
| 694 | free_page(tmp); | 694 | free_page(tmp); |
| 695 | } | 695 | } |
| 696 | 696 | ||
| 697 | free_page((unsigned long)stat->pages); | ||
| 698 | stat->pages = NULL; | 697 | stat->pages = NULL; |
| 699 | stat->start = NULL; | 698 | stat->start = NULL; |
| 700 | 699 | ||
| @@ -4131,7 +4130,8 @@ ftrace_ops_control_func(unsigned long ip, unsigned long parent_ip, | |||
| 4131 | preempt_disable_notrace(); | 4130 | preempt_disable_notrace(); |
| 4132 | trace_recursion_set(TRACE_CONTROL_BIT); | 4131 | trace_recursion_set(TRACE_CONTROL_BIT); |
| 4133 | do_for_each_ftrace_op(op, ftrace_control_list) { | 4132 | do_for_each_ftrace_op(op, ftrace_control_list) { |
| 4134 | if (!ftrace_function_local_disabled(op) && | 4133 | if (!(op->flags & FTRACE_OPS_FL_STUB) && |
| 4134 | !ftrace_function_local_disabled(op) && | ||
| 4135 | ftrace_ops_test(op, ip)) | 4135 | ftrace_ops_test(op, ip)) |
| 4136 | op->func(ip, parent_ip, op, regs); | 4136 | op->func(ip, parent_ip, op, regs); |
| 4137 | } while_for_each_ftrace_op(op); | 4137 | } while_for_each_ftrace_op(op); |
| @@ -4555,12 +4555,8 @@ ftrace_enable_sysctl(struct ctl_table *table, int write, | |||
| 4555 | ftrace_startup_sysctl(); | 4555 | ftrace_startup_sysctl(); |
| 4556 | 4556 | ||
| 4557 | /* we are starting ftrace again */ | 4557 | /* we are starting ftrace again */ |
| 4558 | if (ftrace_ops_list != &ftrace_list_end) { | 4558 | if (ftrace_ops_list != &ftrace_list_end) |
| 4559 | if (ftrace_ops_list->next == &ftrace_list_end) | 4559 | update_ftrace_function(); |
| 4560 | ftrace_trace_function = ftrace_ops_list->func; | ||
| 4561 | else | ||
| 4562 | ftrace_trace_function = ftrace_ops_list_func; | ||
| 4563 | } | ||
| 4564 | 4560 | ||
| 4565 | } else { | 4561 | } else { |
| 4566 | /* stopping ftrace calls (just send to ftrace_stub) */ | 4562 | /* stopping ftrace calls (just send to ftrace_stub) */ |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 4f1dade56981..7ba7fc76f9eb 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
| @@ -744,8 +744,11 @@ update_max_tr_single(struct trace_array *tr, struct task_struct *tsk, int cpu) | |||
| 744 | return; | 744 | return; |
| 745 | 745 | ||
| 746 | WARN_ON_ONCE(!irqs_disabled()); | 746 | WARN_ON_ONCE(!irqs_disabled()); |
| 747 | if (WARN_ON_ONCE(!current_trace->allocated_snapshot)) | 747 | if (!current_trace->allocated_snapshot) { |
| 748 | /* Only the nop tracer should hit this when disabling */ | ||
| 749 | WARN_ON_ONCE(current_trace != &nop_trace); | ||
| 748 | return; | 750 | return; |
| 751 | } | ||
| 749 | 752 | ||
| 750 | arch_spin_lock(&ftrace_max_lock); | 753 | arch_spin_lock(&ftrace_max_lock); |
| 751 | 754 | ||
