Re: output: was: Re: [PATCH v4] printk: Userspace format enumeration support

From: Chris Down
Date: Wed Feb 17 2021 - 16:25:46 EST


Steven Rostedt writes:
OK, now do the same in C. "%q" "and I guess that "f" in the print statement
in python (but I don't know for sure) does some magic with converting the
"\n" and such.

I agree with Petr on this. Print the format itself, and not what is
converted. It's much easier to convert "\t" and such to what they mean,
than to go the other way around.

To be clear, you're advocating for escaping tabs/newlines/etc on the kernel side, right?

That seems to be implied by your first paragraph, but "print the format itself and not what is converted" sounds like the opposite of that to me. I assume your meaning is "escape the format, don't print it raw", which is what Petr was also advocating for? :-)