public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Theodore Tso <tytso@mit.edu>,
	Arjan van de Ven <arjan@infradead.org>,
	Christoph Hellwig <hch@lst.de>,
	Mathieu Desnoyers <compudj@krystal.dyndns.org>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	Zhaolei <zhaolei@cn.fujitsu.com>, Li Zefan <lizf@cn.fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Masami Hiramatsu <mhiramat@redhat.com>,
	"Frank Ch. Eigler" <fche@elastic.org>,
	Tom Zanussi <tzanussi@gmail.com>,
	Jiaying Zhang <jiayingz@google.com>,
	Michael Rubin <mrubin@google.com>,
	Martin Bligh <mbligh@google.com>
Subject: Re: [PATCH 1/4] tracing/events: fix compile for modules disabled
Date: Wed, 15 Apr 2009 18:07:56 +0200	[thread overview]
Message-ID: <20090415160755.GE5989@nowhere> (raw)
In-Reply-To: <20090415031604.688830915@goodmis.org>

On Tue, Apr 14, 2009 at 11:15:12PM -0400, Steven Rostedt wrote:
> From: Steven Rostedt <srostedt@redhat.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@elte.hu>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.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
> 
> -- 


  reply	other threads:[~2009-04-15 16:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-15  3:15 [PATCH 0/4] [GIT PULL] more updates for TRACE_EVENTS for modules Steven Rostedt
2009-04-15  3:15 ` [PATCH 1/4] tracing/events: fix compile for modules disabled Steven Rostedt
2009-04-15 16:07   ` Frederic Weisbecker [this message]
2009-04-15 16:27     ` Steven Rostedt
2009-04-15  3:15 ` [PATCH 2/4] tracing/events: fix lockdep system name Steven Rostedt
2009-04-15  6:34   ` Ingo Molnar
2009-04-15  9:32   ` Peter Zijlstra
2009-04-15  3:15 ` [PATCH 3/4] tracing/events: move trace point headers into include/trace/events Steven Rostedt
2009-04-15  3:15 ` [PATCH 4/4] tracing/events: add trace-events-sample Steven Rostedt
2009-04-15 16:15   ` Frederic Weisbecker
2009-04-16 16:58   ` Christoph Hellwig
2009-04-16 17:34     ` Steven Rostedt
2009-04-16 17:36       ` Christoph Hellwig
2009-04-16 17:46         ` Steven Rostedt
2009-04-16 18:25       ` Sam Ravnborg
2009-04-15  7:27 ` [PATCH 0/4] [GIT PULL] more updates for TRACE_EVENTS for modules Ingo Molnar
2009-04-15 10:09   ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090415160755.GE5989@nowhere \
    --to=fweisbec@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=compudj@krystal.dyndns.org \
    --cc=fche@elastic.org \
    --cc=hch@lst.de \
    --cc=jeremy@goop.org \
    --cc=jiayingz@google.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mbligh@google.com \
    --cc=mhiramat@redhat.com \
    --cc=mingo@elte.hu \
    --cc=mrubin@google.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tytso@mit.edu \
    --cc=tzanussi@gmail.com \
    --cc=zhaolei@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox