Re: [PATCH] lib: vsprintf: add printf format conversion %M for errno strings

From: Enrico Weigelt, metux IT consult
Date: Sun Jun 25 2017 - 20:43:13 EST


On 26.06.2017 00:47, Randy Dunlap wrote:

> but why not just do that in userspace.

Patch up syslogd (which one, actually?) to decode all the dozens of
different cases that print out errno values ?

Applying your argument more consequently - why do we have human-readable
messages at all, instead of just writing out message IDs as hexdumps or
binary stream (would make the kernel a lot smaller) ?

> but there's not really much need for it to be in the mainline kernel.

The idea was having a generic and convenient solution that can be used
by other parts of the kernel, too. (just like w/ all the other logging
helpers). That's also the reason why I added into vsprintf().

> So when your driver prints "blah: foo bar error 49",
> just run a little program that converts 49 to <whatever>.

How could that help when userland isn't even up yet ?


--mtx

--
Enrico, Sohn von Wilfried, a.d.F. Weigelt,
metux IT consulting
+49-151-27565287