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

From: Lai Jiangshan
Date: Thu Nov 18 2010 - 00:44:26 EST


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...

> + .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/