Re: [PATCH 2.6.32] ftrace: fix event format export

From: Johannes Berg
Date: Fri Nov 13 2009 - 08:29:45 EST


On Fri, 2009-11-13 at 14:22 +0100, Andreas Schwab wrote:
> Johannes Berg <johannes@xxxxxxxxxxxxxxxx> writes:
>
> > --- wireless-testing.orig/include/trace/ftrace.h 2009-11-13 13:15:21.000000000 +0100
> > +++ wireless-testing/include/trace/ftrace.h 2009-11-13 13:34:03.000000000 +0100
> > @@ -159,7 +159,7 @@
> > #undef __get_str
> >
> > #undef TP_printk
> > -#define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args)
> > +#define TP_printk(fmt, args...) "\"%s\", %s\n", fmt, __stringify(args)
>
> Would using __stringify(fmt) work? If there are double quote characters
> in fmt your solution would produce output that is ambiguous.

No, for say

#define FOO_FMT "foo:%d"

and using
FOO_FMT ", %d"
that would give
""%s", %d"
instead of
"%s, %d"

However, isn't it already ambiguous that way? I fail to see why %s, #fmt
would preserve inside " properly.

johannes

Attachment: signature.asc
Description: This is a digitally signed message part