From: Steven Rostedt <rostedt@goodmis.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com
Subject: Re: [PATCH v3] rcu: define tracepoint strings only if CONFIG_TRACING is set
Date: Mon, 14 Jul 2014 13:03:02 -0400 [thread overview]
Message-ID: <20140714130302.59644d42@gandalf.local.home> (raw)
In-Reply-To: <1405184509-12601-1-git-send-email-ard.biesheuvel@linaro.org>
On Sat, 12 Jul 2014 19:01:49 +0200
Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> Commit f7f7bac9cb1c ("rcu: Have the RCU tracepoints use the tracepoint_string
> infrastructure") unconditionally populates the __tracepoint_str input section,
> but this section is not assigned an output section if CONFIG_TRACING is not set.
> This results in the __tracepoint_str turning up in unexpected places, i.e.,
> after _edata.
>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: rostedt@goodmis.org
> Cc: paulmck@linux.vnet.ibm.com
> ---
> v3:
> - make definition of <var>_varname conditional as well
> v2:
> - s/DEFINE_TPS/DEFINE_RCU_TPS/
>
> kernel/rcu/tree.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index f1ba77363fbb..0756a4696007 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -79,9 +79,18 @@ static struct lock_class_key rcu_fqs_class[RCU_NUM_LVLS];
> * the tracing userspace tools to be able to decipher the string
> * address to the matching string.
> */
> -#define RCU_STATE_INITIALIZER(sname, sabbr, cr) \
> +#ifdef CONFIG_TRACING
> +# define DEFINE_RCU_TPS(sname) \
> static char sname##_varname[] = #sname; \
> -static const char *tp_##sname##_varname __used __tracepoint_string = sname##_varname; \
> +static const char *tp_##sname##_varname __used __tracepoint_string = sname##_varname;
> +# define RCU_STATE_NAME(sname) sname##_varname
> +#else
> +# define DEFINE_RCU_TPS(sname)
> +# define RCU_STATE_NAME(sname) __stringify(sname)
> +#endif
> +
> +#define RCU_STATE_INITIALIZER(sname, sabbr, cr) \
> +DEFINE_RCU_TPS(sname) \
> struct rcu_state sname##_state = { \
> .level = { &sname##_state.node[0] }, \
> .call = cr, \
> @@ -93,7 +102,7 @@ struct rcu_state sname##_state = { \
> .orphan_donetail = &sname##_state.orphan_donelist, \
> .barrier_mutex = __MUTEX_INITIALIZER(sname##_state.barrier_mutex), \
> .onoff_mutex = __MUTEX_INITIALIZER(sname##_state.onoff_mutex), \
> - .name = sname##_varname, \
> + .name = RCU_STATE_NAME(sname), \
> .abbr = sabbr, \
> }; \
> DEFINE_PER_CPU(struct rcu_data, sname##_data)
next prev parent reply other threads:[~2014-07-14 17:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-12 17:01 Ard Biesheuvel
2014-07-14 17:03 ` Steven Rostedt [this message]
2014-07-16 11:55 ` Paul E. McKenney
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=20140714130302.59644d42@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=ard.biesheuvel@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.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
all inboxes | Powered by JetHome®