Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp910988ybe; Wed, 4 Sep 2019 09:30:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxo06JczGLXULgm9SXtjL2KLdtYe0mkq39O77qdiy75O0A59yumc9N6fCjQurwESMEmxWV7 X-Received: by 2002:a17:90a:fa89:: with SMTP id cu9mr5751738pjb.139.1567614650919; Wed, 04 Sep 2019 09:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567614650; cv=none; d=google.com; s=arc-20160816; b=F8ioxwsKoSQdxxkcgkY3lnw6Sd88rFGyGJOpJJeGJbGpTydxJUMEpdC2h04b5SeXpb tT6NBvMYMl/QqtWbupYhYmBs4CFxKMNw5Ot+dw5FWh/uTOuNytPpbXhZQIZaleeqMGE5 K5dq0nN14RR22CXM9lH1RMAQXc8zKFY5SsOdyl6qZXme5+LnzMi5MD519A8d8Y0DzjSD Lrpx5ctmgkrT03wbucFoHPFbGZDil6d1cczNryEwxtT6r/cYOkvv1R2JHrVJV6K5bUDh aSgBkuW+yS6RXNl+ZZnppLd20HRUjSxaFHMgvc3iY3sNIWhJ0/4/BQG5MnPKu5fGWzLy cyJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:mime-version:user-agent:date :message-id:subject:autocrypt:openpgp:from:references:cc:to; bh=ipQidaLqR3abkvLRfzOxHSYfo4O9dO4NovnJFfYzVQE=; b=fP3hMR0RY9fPlPxL0y6UauHH4EOZ5ebiMwg4FsEFdvW00pI+Sw/uxmmIdhOJLRpSUa +u5SdMpJLwt6QAAKSTkN4NyE0EqrltuYgsjeczI3a4SKGSidkkvAQRdaNct2WhB2OGTh DACzKpZCH/9OHcQ4i9GsrTgAZpsgANPqorWttCRt+Q5btgA8/7gf/U1Q6Ig3wBfLmOF/ 7c9au3h1Crn+LwDbMiYPcMhAsi7cu9mixNv/Ks2SOyhyx/AF2kiK9ggRvR5U/CFQA5Mx INgliHyP/wANaC+3Vo13MqFetz3GRYNt4vEQezeeYj4MExctQsOF0g1AJZPm1o6tNzDV ZGwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w18si10929693pfn.277.2019.09.04.09.30.33; Wed, 04 Sep 2019 09:30:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731868AbfIDQ3H (ORCPT + 99 others); Wed, 4 Sep 2019 12:29:07 -0400 Received: from antares.kleine-koenig.org ([94.130.110.236]:32834 "EHLO antares.kleine-koenig.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731600AbfIDQ3H (ORCPT ); Wed, 4 Sep 2019 12:29:07 -0400 Received: from localhost (localhost [127.0.0.1]) by antares.kleine-koenig.org (Postfix) with ESMTP id 415117974A9; Wed, 4 Sep 2019 18:29:04 +0200 (CEST) Received: from antares.kleine-koenig.org ([127.0.0.1]) by localhost (antares.kleine-koenig.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ig4UvhKpQStG; Wed, 4 Sep 2019 18:29:03 +0200 (CEST) Received: from [IPv6:2a02:8071:b5c2:53fc:e7de:963a:aedd:43f8] (unknown [IPv6:2a02:8071:b5c2:53fc:e7de:963a:aedd:43f8]) by antares.kleine-koenig.org (Postfix) with ESMTPSA; Wed, 4 Sep 2019 18:29:03 +0200 (CEST) To: Andy Shevchenko , Rasmus Villemoes Cc: Sergey Senozhatsky , Petr Mladek , Andrew Morton , Jani Nikula , Joe Perches , Juergen Gross , Linux Kernel Mailing List References: <20190830214655.6625-1-linux@rasmusvillemoes.dk> From: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= Openpgp: preference=signencrypt Autocrypt: addr=uwe@kleine-koenig.org; prefer-encrypt=mutual; keydata= mQINBEwXmCYBEACoJSJcKIlkQcTYia0ymmMOBk2veFoy/a0LlqGUEjQ4WECBL19F2BYX1dSp 5/ZdfKuV605usI6oq4x6k/LKmqZDl6YnqW/YmN/iZVCRunBRfvpTlL4lcNUu5Va/4GBRzBRr rrIhCIVL5zMV6hKywhHKTdOHVSZRftf+eRSBwENKXahmfOMDmekyf585etDPdzkFrLHNVFOC sFOU0gCK0uVPyY0LH13eo4qEEMi88RCOfwYCFQqKXDdo41DWoDPB5OGCMaphIx9wC/nvtdcv MowsGde5iGgmHWK6sdC/O/xaV7fnz1sJzoJB1eT91LkGbdGxsLAT6nqlaNJiJtiBoRhscguV xVbn/I9mnUu7bLmTFBEAlaQGU/J7uQ4w94FXfosNGROt/otqltetMZlPbNvNhKnXv8U6eRyA P3ZMKTJa4hGr3UdYdt4+MIiHcsANWp8T7oLYVxRbHPXPG49IURnhXUoGbscZmpptWcl29ebo qCxL9n3KIyUT3ZB1xHbW3Sk/Dqzf52tQOxZubzrpUJ8zaGIwYVUjfcPFwf3R3zrQvJq7mI4S ddNIE8w3WJOPXDOYx7GjOa+IubhSpCrr74NbN8q9oS3hnsqWw16i3HSUuPuYeZo1t6D5p/mX EVyZ2QrS1kGgGi7bmlQMSFkb6g1T8aWSYuX3PBYq2VntnWAXPwARAQABtClVd2UgS2xlaW5l LUvDtm5pZyA8dXdlQGtsZWluZS1rb2VuaWcub3JnPokCVwQTAQoAQQIbAwULCQgHAwUVCgkI CwUWAgMBAAIeAQIXgAIZARYhBA0lEfMiv6scFYAma+Lc3ZEyZpvWBQJdD2/6BQkaXdlUAAoJ EOLc3ZEyZpvWXJI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Nj7UhnvazBhMaMhCEt8rNqr5/dbgvAD/biSZO6wZrn7 hCaye/ulWpSqZSdx+G9GkTn05lsuHu9zfTwY6B0A6nlrqQSR/yWPvSq1Ud6IOZY1alq7ZSag kC8vBDJg Subject: Re: [PATCH] printf: add support for printing symbolic error codes Message-ID: Date: Wed, 4 Sep 2019 18:28:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oUCv2sFsaUWo4hGcOqZrkACrD9ZkSReYp" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --oUCv2sFsaUWo4hGcOqZrkACrD9ZkSReYp Content-Type: multipart/mixed; boundary="6M4qBJ8coK5KgUM1PV3RRkh1iqib0ksLQ"; protected-headers="v1" From: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= To: Andy Shevchenko , Rasmus Villemoes Cc: Sergey Senozhatsky , Petr Mladek , Andrew Morton , Jani Nikula , Joe Perches , Juergen Gross , Linux Kernel Mailing List Message-ID: Subject: Re: [PATCH] printf: add support for printing symbolic error codes References: <20190830214655.6625-1-linux@rasmusvillemoes.dk> In-Reply-To: --6M4qBJ8coK5KgUM1PV3RRkh1iqib0ksLQ Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 9/4/19 6:19 PM, Andy Shevchenko wrote: > On Sat, Aug 31, 2019 at 12:48 AM Rasmus Villemoes > wrote: >> >> It has been suggested several times to extend vsnprintf() to be able >> to convert the numeric value of ENOSPC to print "ENOSPC". This is yet >> another attempt. Rather than adding another %p extension, simply teach= >> plain %p to convert ERR_PTRs. While the primary use case is >> >> if (IS_ERR(foo)) { >> pr_err("Sorry, can't do that: %p\n", foo); >> return PTR_ERR(foo); >> } >> >> it is also more helpful to get a symbolic error code (or, worst case, >> a decimal number) in case an ERR_PTR is accidentally passed to some >> %p, rather than the (efault) that check_pointer() would >> result in. >> >> With my embedded hat on, I've made it possible to remove this. >> >> I've tested that the #ifdeffery in errcode.c is sufficient to make >> this compile on arm, arm64, mips, powerpc, s390, x86 - I'm sure the >> 0day bot will tell me which ones I've missed. >> >> The symbols to include have been found by massaging the output of >> >> find arch include -iname 'errno*.h' | xargs grep -E 'define\s*E' >> >> In the cases where some common aliasing exists >> (e.g. EAGAIN=3DEWOULDBLOCK on all platforms, EDEADLOCK=3DEDEADLK on mo= st), >> I've moved the more popular one (in terms of 'git grep -w Efoo | wc) >> to the bottom so that one takes precedence. >=20 >> +/* >> + * Ensure these tables to not accidentally become gigantic if some >> + * huge errno makes it in. On most architectures, the first table wil= l >> + * only have about 140 entries, but mips and parisc have more sparsel= y >> + * allocated errnos (with EHWPOISON =3D 257 on parisc, and EDQUOT =3D= 1133 >> + * on mips), so this wastes a bit of space on those - though we >> + * special case the EDQUOT case. >> + */ >> +#define E(err) [err + BUILD_BUG_ON_ZERO(err <=3D 0 || err > 300)] =3D= #err >=20 > Hmm... Perhaps better to define the upper boundary with something like >=20 > #define __E_POSIX_UPPER_BOUNDARY 300 // name sucks, I know >=20 >> +#define E(err) [err - 512 + BUILD_BUG_ON_ZERO(err < 512 || err > 550)= ] =3D #err >=20 > Similar to 550? I'd not add "POSIX" in the name. Given that the arrays are called codes_0 and codes_512 I don't think using plain numbers hurts much and choosing a good name is hard, so I suggest to keep the explicit numbers. >> +const char *errcode(int err) >> +{ >> + /* Might as well accept both -EIO and EIO. */ >> + if (err < 0) >> + err =3D -err; >> + if (err <=3D 0) /* INT_MIN or 0 */ >> + return NULL; >> + if (err < ARRAY_SIZE(codes_0)) >> + return codes_0[err]; >> + if (err >=3D 512 && err - 512 < ARRAY_SIZE(codes_512)) >> + return codes_512[err - 512]; >> + /* But why? */ >> + if (IS_ENABLED(CONFIG_MIPS) && err =3D=3D EDQUOT) /* 1133 */ >> + return "EDQUOT"; >=20 > Another possibility is to initialize the errors at run time with radix = tree. The idea was to save space. But when using a radix tree this has overhead compared to the lists here, and you still need a map for error-code -> error-name to initialize the radix tree. Also a lookup is slower than with the idea implemented here. So it's bigger, slower and more complicated ... I don't think we should do that. >=20 >> + return NULL; >> +} >=20 >> @@ -2111,6 +2112,31 @@ static noinline_for_stack >> char *pointer(const char *fmt, char *buf, char *end, void *ptr, >> struct printf_spec spec) >> { >> + /* %px means the user explicitly wanted the pointer formatted = as a hex value. */ >> + if (*fmt =3D=3D 'x') >> + return pointer_string(buf, end, ptr, spec); >=20 > But instead of breaking switch case apart can we use... >=20 >> + >> + /* If it's an ERR_PTR, try to print its symbolic representatio= n. */ >> + if (IS_ERR(ptr)) { >=20 > ... if (IS_ERR() && *fmt !=3D 'x') { > here? I don't feel strong here, works either way for me. Best regards Uwe --6M4qBJ8coK5KgUM1PV3RRkh1iqib0ksLQ-- --oUCv2sFsaUWo4hGcOqZrkACrD9ZkSReYp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAl1v5kkACgkQwfwUeK3K 7Am0Bwf/R5r7SshdhmMQoVYeuWC5qlf0WeOP2O6cs790hAyszKM9rRHqiSPT0U9O NhAm+lEvxXkrKxzzRxIOxDrpTSpFjBFrg43i1AubD6ztYWDbD/PulHhinFOcq1+C IcE4LCpPUUul5Sa1VA+6H5GvsRSVOiO/NoDH8nMUij1rCri3juoNp8e8O7O8DtAF hrSCtPzID9n8cML+KnqLonZAJxjWfM9HuYg+9tQyXu5zc5+AfU76k8keVmgOgovA jM6HY5bB6CG1niTxDEs2QP6ofUo9z4sP8Ej3x3wSblbDdVk+93/kWZjGqdEkxcMK RoH5ED/2lUYylBGmvKtCwuEn+3MI6Q== =HWXO -----END PGP SIGNATURE----- --oUCv2sFsaUWo4hGcOqZrkACrD9ZkSReYp--