[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090310105624.GD6825@nowhere>
Date: Tue, 10 Mar 2009 11:56:25 +0100
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>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Mathieu Desnoyers <compudj@...stal.dyndns.org>,
Lai Jiangshan <laijs@...fujitsu.com>,
"Martin J. Bligh" <mbligh@...igh.org>,
"Frank Ch. Eigler" <fche@...hat.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Larry Woodman <lwoodman@...hat.com>,
Jason Baron <jbaron@...hat.com>,
Tom Zanussi <tzanussi@...il.com>,
Masami Hiramatsu <mhiramat@...hat.com>,
Christoph Hellwig <hch@...radead.org>,
Jiaying Zhang <jiayingz@...gle.com>,
Steven Rostedt <srostedt@...hat.com>
Subject: Re: [PATCH 3/7] tracing: use generic __stringify
On Tue, Mar 10, 2009 at 12:57:13AM -0400, Steven Rostedt wrote:
> From: Steven Rostedt <srostedt@...hat.com>
>
> Impact: clean up
>
> This removes the custom made STR(x) macros in the tracer and uses
> the generic __stringify macro instead.
>
> Signed-off-by: Steven Rostedt <srostedt@...hat.com>
> ---
Hi,
Why not simply use the # ?
Frederic.
> kernel/trace/events.c | 4 +---
> kernel/trace/trace_events_stage_3.h | 4 ++--
> kernel/trace/trace_selftest.c | 6 ++----
> 3 files changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/kernel/trace/events.c b/kernel/trace/events.c
> index f2509cb..9fc918d 100644
> --- a/kernel/trace/events.c
> +++ b/kernel/trace/events.c
> @@ -2,9 +2,7 @@
> * This is the place to register all trace points as events.
> */
>
> -/* someday this needs to go in a generic header */
> -#define __STR(x) #x
> -#define STR(x) __STR(x)
> +#include <linux/stringify.h>
>
> #include <trace/trace_events.h>
>
> diff --git a/kernel/trace/trace_events_stage_3.h b/kernel/trace/trace_events_stage_3.h
> index 557ca52..41b82b9 100644
> --- a/kernel/trace/trace_events_stage_3.h
> +++ b/kernel/trace/trace_events_stage_3.h
> @@ -139,7 +139,7 @@ static struct ftrace_event_call __used \
> __attribute__((__aligned__(4))) \
> __attribute__((section("_ftrace_events"))) event_##call = { \
> .name = #call, \
> - .system = STR(TRACE_SYSTEM), \
> + .system = __stringify(TRACE_SYSTEM), \
> .regfunc = ftrace_reg_event_##call, \
> .unregfunc = ftrace_unreg_event_##call, \
> }
> @@ -225,7 +225,7 @@ static struct ftrace_event_call __used \
> __attribute__((__aligned__(4))) \
> __attribute__((section("_ftrace_events"))) event_##call = { \
> .name = #call, \
> - .system = STR(TRACE_SYSTEM), \
> + .system = __stringify(TRACE_SYSTEM), \
> .regfunc = ftrace_reg_event_##call, \
> .unregfunc = ftrace_unreg_event_##call, \
> .raw_init = ftrace_raw_init_event_##call, \
> diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
> index 7238646..f907a2b 100644
> --- a/kernel/trace/trace_selftest.c
> +++ b/kernel/trace/trace_selftest.c
> @@ -1,5 +1,6 @@
> /* Include in trace.c */
>
> +#include <linux/stringify.h>
> #include <linux/kthread.h>
> #include <linux/delay.h>
>
> @@ -100,9 +101,6 @@ static inline void warn_failed_init_tracer(struct tracer *trace, int init_ret)
>
> #ifdef CONFIG_DYNAMIC_FTRACE
>
> -#define __STR(x) #x
> -#define STR(x) __STR(x)
> -
> /* Test dynamic code modification and ftrace filters */
> int trace_selftest_startup_dynamic_tracing(struct tracer *trace,
> struct trace_array *tr,
> @@ -130,7 +128,7 @@ int trace_selftest_startup_dynamic_tracing(struct tracer *trace,
> * start of the function names. We simply put a '*' to
> * accommodate them.
> */
> - func_name = "*" STR(DYN_FTRACE_TEST_NAME);
> + func_name = "*" __stringify(DYN_FTRACE_TEST_NAME);
>
> /* filter only on our function */
> ftrace_set_filter(func_name, strlen(func_name), 1);
> --
> 1.6.1.3
>
> --
--
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