diff options
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index eca592f977b2..57a6eea84694 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -4961,7 +4961,7 @@ void ftrace_release_mod(struct module *mod) | |||
4961 | mutex_unlock(&ftrace_lock); | 4961 | mutex_unlock(&ftrace_lock); |
4962 | } | 4962 | } |
4963 | 4963 | ||
4964 | static void ftrace_module_enable(struct module *mod) | 4964 | void ftrace_module_enable(struct module *mod) |
4965 | { | 4965 | { |
4966 | struct dyn_ftrace *rec; | 4966 | struct dyn_ftrace *rec; |
4967 | struct ftrace_page *pg; | 4967 | struct ftrace_page *pg; |
@@ -5038,38 +5038,8 @@ void ftrace_module_init(struct module *mod) | |||
5038 | ftrace_process_locs(mod, mod->ftrace_callsites, | 5038 | ftrace_process_locs(mod, mod->ftrace_callsites, |
5039 | mod->ftrace_callsites + mod->num_ftrace_callsites); | 5039 | mod->ftrace_callsites + mod->num_ftrace_callsites); |
5040 | } | 5040 | } |
5041 | |||
5042 | static int ftrace_module_notify(struct notifier_block *self, | ||
5043 | unsigned long val, void *data) | ||
5044 | { | ||
5045 | struct module *mod = data; | ||
5046 | |||
5047 | switch (val) { | ||
5048 | case MODULE_STATE_COMING: | ||
5049 | ftrace_module_enable(mod); | ||
5050 | break; | ||
5051 | case MODULE_STATE_GOING: | ||
5052 | ftrace_release_mod(mod); | ||
5053 | break; | ||
5054 | default: | ||
5055 | break; | ||
5056 | } | ||
5057 | |||
5058 | return 0; | ||
5059 | } | ||
5060 | #else | ||
5061 | static int ftrace_module_notify(struct notifier_block *self, | ||
5062 | unsigned long val, void *data) | ||
5063 | { | ||
5064 | return 0; | ||
5065 | } | ||
5066 | #endif /* CONFIG_MODULES */ | 5041 | #endif /* CONFIG_MODULES */ |
5067 | 5042 | ||
5068 | struct notifier_block ftrace_module_nb = { | ||
5069 | .notifier_call = ftrace_module_notify, | ||
5070 | .priority = INT_MIN, /* Run after anything that can remove kprobes */ | ||
5071 | }; | ||
5072 | |||
5073 | void __init ftrace_init(void) | 5043 | void __init ftrace_init(void) |
5074 | { | 5044 | { |
5075 | extern unsigned long __start_mcount_loc[]; | 5045 | extern unsigned long __start_mcount_loc[]; |
@@ -5098,10 +5068,6 @@ void __init ftrace_init(void) | |||
5098 | __start_mcount_loc, | 5068 | __start_mcount_loc, |
5099 | __stop_mcount_loc); | 5069 | __stop_mcount_loc); |
5100 | 5070 | ||
5101 | ret = register_module_notifier(&ftrace_module_nb); | ||
5102 | if (ret) | ||
5103 | pr_warning("Failed to register trace ftrace module exit notifier\n"); | ||
5104 | |||
5105 | set_ftrace_early_filters(); | 5071 | set_ftrace_early_filters(); |
5106 | 5072 | ||
5107 | return; | 5073 | return; |