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>
This commit is contained in:
Oleg Nesterov 2013-07-31 19:31:37 +02:00 committed by Steven Rostedt
parent 620a30e97f
commit 836d481ed7
1 changed files with 6 additions and 12 deletions

View File

@ -1820,12 +1820,10 @@ static int trace_module_notify(struct notifier_block *self,
return 0; return 0;
} }
#else static struct notifier_block trace_module_nb = {
static inline int trace_module_notify(struct notifier_block *self, .notifier_call = trace_module_notify,
unsigned long val, void *data) .priority = 0,
{ };
return 0;
}
#endif /* CONFIG_MODULES */ #endif /* CONFIG_MODULES */
/* Create a new event directory structure for a trace directory. */ /* 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)
__trace_add_new_event(call, tr); __trace_add_new_event(call, tr);
} }
static struct notifier_block trace_module_nb = {
.notifier_call = trace_module_notify,
.priority = 0,
};
extern struct ftrace_event_call *__start_ftrace_events[]; extern struct ftrace_event_call *__start_ftrace_events[];
extern struct ftrace_event_call *__stop_ftrace_events[]; extern struct ftrace_event_call *__stop_ftrace_events[];
@ -2402,10 +2395,11 @@ static __init int event_trace_init(void)
if (ret) if (ret)
return ret; return ret;
#ifdef CONFIG_MODULES
ret = register_module_notifier(&trace_module_nb); ret = register_module_notifier(&trace_module_nb);
if (ret) if (ret)
pr_warning("Failed to register trace events module notifier\n"); pr_warning("Failed to register trace events module notifier\n");
#endif
return 0; return 0;
} }
early_initcall(event_trace_memsetup); early_initcall(event_trace_memsetup);