linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Jia He <justin.he@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Jonathan Corbet <corbet@lwn.net>,
	Luca Coelho <luciano.coelho@intel.com>,
	Kalle Valo <kvalo@codeaurora.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Johannes Berg <johannes.berg@intel.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-s390@vger.kernel.org
Subject: Re: [PATCH 2/4] lib/vsprintf.c: Make %p{D,d} mean as much components as possible
Date: Thu, 29 Apr 2021 10:46:30 +0200	[thread overview]
Message-ID: <YIpyZmi1Reh7iXeI@alley> (raw)
In-Reply-To: <20210428135929.27011-2-justin.he@arm.com>

On Wed 2021-04-28 21:59:27, Jia He wrote:
> From: Linus Torvalds <torvalds@linux-foundation.org>
> 
> We have '%pD'(no digit following) for printing a filename. It may not be
> perfect (by default it only prints one component.
> 
> %pD4 should be more than good enough, but we should make plain "%pD" mean
> "as much of the path that is reasonable" rather than "as few components as
> possible" (ie 1).

Could you please provide link to the discussion where this idea was
came from?

It would be great to add and example into the commit message how
it improved the output.

Also please explain why it is useful/safe to change the behavior
for all existing users. It seems that you checked them and prevented
any regression by the other patches in this patchset.

Anyway, some regressions are fixed by the followup patches.
It would break bisection.

We either need to prevent the regression before this patch.
Or the changes have to be done in this patch. For example,
it would be perfectly fine to update test_printf.c in
this patch.

> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

If you want to keep Linus as the author and do more changes, you might
describe here changes done by you, for example:

[justin.he@arm.com: update documentation and test_printf]
Signed-off-by: Jia He <justin.he@arm.com>

Or you might make you the author and add

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>

> ---
>  Documentation/core-api/printk-formats.rst | 3 ++-
>  lib/vsprintf.c                            | 4 ++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst
> index 9be6de402cb9..aa76cbec0dae 100644
> --- a/Documentation/core-api/printk-formats.rst
> +++ b/Documentation/core-api/printk-formats.rst

Plese, update also the pattern:

-	%pd{,2,3,4}
-	%pD{,2,3,4}
+	%pd{1,2,3,4}
+	%pD{1,2,3,4}

> @@ -413,7 +413,8 @@ dentry names
>  For printing dentry name; if we race with :c:func:`d_move`, the name might
>  be a mix of old and new ones, but it won't oops.  %pd dentry is a safer
>  equivalent of %s dentry->d_name.name we used to use, %pd<n> prints ``n``
> -last components.  %pD does the same thing for struct file.
> +last components.  %pD does the same thing for struct file. By default, %p{D,d}
> +is equal to %p{D,d}4.
>  
>  Passed by reference.

Best Regards,
Petr

  parent reply	other threads:[~2021-04-29  8:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 13:59 [PATCH 1/4] iwlwifi: mvm: Explicitly use %pd1 in debugfs entry Jia He
2021-04-28 13:59 ` [PATCH 2/4] lib/vsprintf.c: Make %p{D,d} mean as much components as possible Jia He
2021-04-28 15:10   ` Andy Shevchenko
2021-04-29  8:46   ` Petr Mladek [this message]
2021-04-29  8:52     ` Andy Shevchenko
2021-04-29  9:24       ` Petr Mladek
2021-04-30  1:35         ` Justin He
2021-04-28 13:59 ` [PATCH 3/4] s390/hmcdrv: Remove the redundant directory path in debug message Jia He
2021-04-28 13:59 ` [PATCH 4/4] lib/test_printf: Explicitly add components number to %pD and %pd Jia He

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YIpyZmi1Reh7iXeI@alley \
    --to=pmladek@suse.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=borntraeger@de.ibm.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=johannes.berg@intel.com \
    --cc=justin.he@arm.com \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=luciano.coelho@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).