Re: [RFC][PATCH 2/2] [PATCH 2/2] tracing: Make event basedtrace_printk()

From: Steven Rostedt
Date: Thu Nov 18 2010 - 07:22:18 EST


On Thu, 2010-11-18 at 13:50 +0800, Lai Jiangshan wrote:
> On 11/18/2010 11:58 AM, Steven Rostedt wrote:
> > +#define trace_printk(fmt, args...) \
> > + do { \
> > + static struct event_printk_struct \
> > + __attribute__((__aligned__(4))) \
> > + __attribute__((section("_trace_printk"))) \
> > + ______t = { \
> > + .format = fmt, \
>
> if fmt is not constant, the compiler will complain...

Ah you are right. I added that after I wrote all this code and wanted
the format to print in the file. The original code required the compile
check below.

-- Steve

>
> > + .func = __func__, \
> > + .file = __FILE__, \
> > + .line = __LINE__, \
> > + }; \
> > + __trace_printk_check_format(fmt, ##args); \
> > + if (!__builtin_constant_p(fmt)) \
> > + trace_printk_can_only_have_constant_format(); \
>
> so this is not need.
>
> > + if (unlikely(__event_printk_test(&______t.enable))) \
> > + __trace_bprintk(_THIS_IP_, fmt, ##args); \
> > + } while (0)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/