diff options
Diffstat (limited to 'kernel/trace')
| -rw-r--r-- | kernel/trace/ftrace.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 165b149ccb1a..6abfafd7f173 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
| @@ -2828,13 +2828,14 @@ static int ftrace_shutdown(struct ftrace_ops *ops, int command) | |||
| 2828 | 2828 | ||
| 2829 | if (!command || !ftrace_enabled) { | 2829 | if (!command || !ftrace_enabled) { |
| 2830 | /* | 2830 | /* |
| 2831 | * If these are per_cpu ops, they still need their | 2831 | * If these are dynamic or per_cpu ops, they still |
| 2832 | * per_cpu field freed. Since, function tracing is | 2832 | * need their data freed. Since, function tracing is |
| 2833 | * not currently active, we can just free them | 2833 | * not currently active, we can just free them |
| 2834 | * without synchronizing all CPUs. | 2834 | * without synchronizing all CPUs. |
| 2835 | */ | 2835 | */ |
| 2836 | if (ops->flags & FTRACE_OPS_FL_PER_CPU) | 2836 | if (ops->flags & (FTRACE_OPS_FL_DYNAMIC | FTRACE_OPS_FL_PER_CPU)) |
| 2837 | per_cpu_ops_free(ops); | 2837 | goto free_ops; |
| 2838 | |||
| 2838 | return 0; | 2839 | return 0; |
| 2839 | } | 2840 | } |
| 2840 | 2841 | ||
| @@ -2900,6 +2901,7 @@ static int ftrace_shutdown(struct ftrace_ops *ops, int command) | |||
| 2900 | if (IS_ENABLED(CONFIG_PREEMPT)) | 2901 | if (IS_ENABLED(CONFIG_PREEMPT)) |
| 2901 | synchronize_rcu_tasks(); | 2902 | synchronize_rcu_tasks(); |
| 2902 | 2903 | ||
| 2904 | free_ops: | ||
| 2903 | arch_ftrace_trampoline_free(ops); | 2905 | arch_ftrace_trampoline_free(ops); |
| 2904 | 2906 | ||
| 2905 | if (ops->flags & FTRACE_OPS_FL_PER_CPU) | 2907 | if (ops->flags & FTRACE_OPS_FL_PER_CPU) |
