Messages in this thread | | | Date | Thu, 18 Nov 2010 13:50:06 +0800 | From | Lai Jiangshan <> | Subject | Re: [RFC][PATCH 2/2] [PATCH 2/2] tracing: Make event based trace_printk() |
| |
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)
| |