[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090415160755.GE5989@nowhere>
Date: Wed, 15 Apr 2009 18:07:56 +0200
From: Frederic Weisbecker <fweisbec@...il.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Theodore Tso <tytso@....edu>,
Arjan van de Ven <arjan@...radead.org>,
Christoph Hellwig <hch@....de>,
Mathieu Desnoyers <compudj@...stal.dyndns.org>,
Jeremy Fitzhardinge <jeremy@...p.org>,
Lai Jiangshan <laijs@...fujitsu.com>,
Zhaolei <zhaolei@...fujitsu.com>, Li Zefan <lizf@...fujitsu.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Masami Hiramatsu <mhiramat@...hat.com>,
"Frank Ch. Eigler" <fche@...stic.org>,
Tom Zanussi <tzanussi@...il.com>,
Jiaying Zhang <jiayingz@...gle.com>,
Michael Rubin <mrubin@...gle.com>,
Martin Bligh <mbligh@...gle.com>
Subject: Re: [PATCH 1/4] tracing/events: fix compile for modules disabled
On Tue, Apr 14, 2009 at 11:15:12PM -0400, Steven Rostedt wrote:
> From: Steven Rostedt <srostedt@...hat.com>
>
> Impact: compile fix
>
> The addition of TRACE_EVENT for modules breaks the build for when
> modules are disabled. This code fixes that.
>
> Reported-by: Ingo Molnar <mingo@...e.hu>
> Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
> ---
> kernel/trace/trace_events.c | 12 ++++++++++--
> 1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index a4b1777..6591d83 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -797,6 +797,7 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events)
> (unsigned long)event < (unsigned long)end; \
> event++)
>
> +#ifdef CONFIG_MODULES
> static void trace_module_add_events(struct module *mod)
> {
> struct ftrace_event_call *call, *start, *end;
> @@ -840,8 +841,8 @@ static void trace_module_remove_events(struct module *mod)
> }
> }
>
> -int trace_module_notify(struct notifier_block *self,
> - unsigned long val, void *data)
> +static int trace_module_notify(struct notifier_block *self,
> + unsigned long val, void *data)
> {
> struct module *mod = data;
>
> @@ -858,6 +859,13 @@ int trace_module_notify(struct notifier_block *self,
>
> return 0;
> }
> +#else
> +static int trace_module_notify(struct notifier_block *self,
> + unsigned long val, void *data)
I don't remember when you register the module notifier but
I guess it is on init time, then you can set this func as __init
if !CONFIG_MODULES.
> +{
> + return 0;
> +}
> +#endif /* CONFIG_MODULES */
>
> struct notifier_block trace_module_nb = {
> .notifier_call = trace_module_notify,
And then you can set this struct as __initdata_or_module, so
that you can safely register this module notifier whatever
config you have, and without consuming any space on the off case.
> --
> 1.6.2.1
>
> --
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists