Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751617AbdFZAm7 (ORCPT ); Sun, 25 Jun 2017 20:42:59 -0400 Received: from zimbra.gr13.net ([46.4.151.110]:43997 "EHLO zimbra.gr13.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751426AbdFZAmy (ORCPT ); Sun, 25 Jun 2017 20:42:54 -0400 Subject: Re: [PATCH] lib: vsprintf: add printf format conversion %M for errno strings To: Randy Dunlap , Joe Perches , linux-kernel@vger.kernel.org References: <20170625171230.7613-1-enrico.weigelt@gr13.net> <1498411624.24295.36.camel@perches.com> <6a12988d-bbcc-54e7-be16-eeeb94f88d57@gr13.net> <1498421449.24295.39.camel@perches.com> <71909969-b6be-d116-3372-7add409c1ec1@gr13.net> <3a8df2e2-114c-9f2c-325a-49f234726b08@infradead.org> From: "Enrico Weigelt, metux IT consult" Message-ID: <22ca3747-ad8a-666c-1d71-1def74103234@gr13.net> Date: Mon, 26 Jun 2017 02:42:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <3a8df2e2-114c-9f2c-325a-49f234726b08@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 941 Lines: 29 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 . 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