diff options
author | Oleg Nesterov <oleg@redhat.com> | 2013-07-31 13:31:37 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-08-21 23:28:03 -0400 |
commit | 836d481ed7c91152c6144ea3a3363cad3940b3e0 (patch) | |
tree | b33beed354fc924b65afd4593ded55cef9f5c488 | |
parent | 620a30e97febc8332590376c94ed0e9dba522bc8 (diff) |
tracing: Kill the !CONFIG_MODULES code in trace_events.c
Move trace_module_nb under CONFIG_MODULES and kill the dummy
trace_module_notify(). Imho it doesn't make sense to define
"struct notifier_block" and its .notifier_call just to avoid
"ifdef" in event_trace_init(), and all other !CONFIG_MODULES
code has already gone away.
Link: http://lkml.kernel.org/r/20130731173137.GA31043@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | kernel/trace/trace_events.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 4e706a01f1f9..368a4d50cc30 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -1820,12 +1820,10 @@ static int trace_module_notify(struct notifier_block *self, | |||
1820 | return 0; | 1820 | return 0; |
1821 | } | 1821 | } |
1822 | 1822 | ||
1823 | #else | 1823 | static struct notifier_block trace_module_nb = { |
1824 | static inline int trace_module_notify(struct notifier_block *self, | 1824 | .notifier_call = trace_module_notify, |
1825 | unsigned long val, void *data) | 1825 | .priority = 0, |
1826 | { | 1826 | }; |
1827 | return 0; | ||
1828 | } | ||
1829 | #endif /* CONFIG_MODULES */ | 1827 | #endif /* CONFIG_MODULES */ |
1830 | 1828 | ||
1831 | /* Create a new event directory structure for a trace directory. */ | 1829 | /* Create a new event directory structure for a trace directory. */ |
@@ -2193,11 +2191,6 @@ static void __add_event_to_tracers(struct ftrace_event_call *call) | |||
2193 | __trace_add_new_event(call, tr); | 2191 | __trace_add_new_event(call, tr); |
2194 | } | 2192 | } |
2195 | 2193 | ||
2196 | static struct notifier_block trace_module_nb = { | ||
2197 | .notifier_call = trace_module_notify, | ||
2198 | .priority = 0, | ||
2199 | }; | ||
2200 | |||
2201 | extern struct ftrace_event_call *__start_ftrace_events[]; | 2194 | extern struct ftrace_event_call *__start_ftrace_events[]; |
2202 | extern struct ftrace_event_call *__stop_ftrace_events[]; | 2195 | extern struct ftrace_event_call *__stop_ftrace_events[]; |
2203 | 2196 | ||
@@ -2402,10 +2395,11 @@ static __init int event_trace_init(void) | |||
2402 | if (ret) | 2395 | if (ret) |
2403 | return ret; | 2396 | return ret; |
2404 | 2397 | ||
2398 | #ifdef CONFIG_MODULES | ||
2405 | ret = register_module_notifier(&trace_module_nb); | 2399 | ret = register_module_notifier(&trace_module_nb); |
2406 | if (ret) | 2400 | if (ret) |
2407 | pr_warning("Failed to register trace events module notifier\n"); | 2401 | pr_warning("Failed to register trace events module notifier\n"); |
2408 | 2402 | #endif | |
2409 | return 0; | 2403 | return 0; |
2410 | } | 2404 | } |
2411 | early_initcall(event_trace_memsetup); | 2405 | early_initcall(event_trace_memsetup); |