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

From: Johannes Berg
Date: Fri Nov 13 2009 - 08:32:59 EST


On Fri, 2009-11-13 at 14:29 +0100, Johannes Berg wrote:

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

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

Never mind, I missed one indirection, so yes, it would preserve that. I
guess I'll have to somehow escape the quotes when copying them out to
userspace.

johannes

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