diff options
Diffstat (limited to 'kernel/trace/trace_events.c')
-rw-r--r-- | kernel/trace/trace_events.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 6c81f9c21426..aa08be69a1b6 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -1050,12 +1050,13 @@ static void trace_module_remove_events(struct module *mod) | |||
1050 | struct ftrace_event_call *call, *p; | 1050 | struct ftrace_event_call *call, *p; |
1051 | bool found = false; | 1051 | bool found = false; |
1052 | 1052 | ||
1053 | down_write(&trace_event_mutex); | ||
1053 | list_for_each_entry_safe(call, p, &ftrace_events, list) { | 1054 | list_for_each_entry_safe(call, p, &ftrace_events, list) { |
1054 | if (call->mod == mod) { | 1055 | if (call->mod == mod) { |
1055 | found = true; | 1056 | found = true; |
1056 | ftrace_event_enable_disable(call, 0); | 1057 | ftrace_event_enable_disable(call, 0); |
1057 | if (call->event) | 1058 | if (call->event) |
1058 | unregister_ftrace_event(call->event); | 1059 | __unregister_ftrace_event(call->event); |
1059 | debugfs_remove_recursive(call->dir); | 1060 | debugfs_remove_recursive(call->dir); |
1060 | list_del(&call->list); | 1061 | list_del(&call->list); |
1061 | trace_destroy_fields(call); | 1062 | trace_destroy_fields(call); |
@@ -1079,6 +1080,7 @@ static void trace_module_remove_events(struct module *mod) | |||
1079 | */ | 1080 | */ |
1080 | if (found) | 1081 | if (found) |
1081 | tracing_reset_current_online_cpus(); | 1082 | tracing_reset_current_online_cpus(); |
1083 | up_write(&trace_event_mutex); | ||
1082 | } | 1084 | } |
1083 | 1085 | ||
1084 | static int trace_module_notify(struct notifier_block *self, | 1086 | static int trace_module_notify(struct notifier_block *self, |