Re: + cred-convert-printks-to-pr_level.patch added to mm-nonmm-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2023-06-26 at 08:08 +0200, Greg KH wrote:
> On Sun, Jun 25, 2023 at 02:38:39PM -0700, Joe Perches wrote:
> > On Sat, 2023-06-24 at 20:58 -0700, Andrew Morton wrote:
> > > The patch titled
> > >      Subject: cred: convert printks to pr_<level>
> > > has been added to the -mm mm-nonmm-unstable branch.  Its filename is
> > >      cred-convert-printks-to-pr_level.patch
> > > 
> > > This patch will shortly appear at
> > >      https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/cred-convert-printks-to-pr_level.patch
> > > 
> > > This patch will later appear in the mm-nonmm-unstable branch at
> > >     git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
> > > 
> > > Before you just go and hit "reply", please:
> > >    a) Consider who else should be cc'ed
> > >    b) Prefer to cc a suitable mailing list as well
> > >    c) Ideally: find the original patch on the mailing list and do a
> > >       reply-to-all to that, adding suitable additional cc's
> > > 
> > > *** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
> > > 
> > > The -mm tree is included into linux-next via the mm-everything
> > > branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
> > > and is updated there every 2-3 working days
> > > 
> > > ------------------------------------------------------
> > > From: tiozhang <tiozhang@xxxxxxxxxxxxxx>
> > > Subject: cred: convert printks to pr_<level>
> > > Date: Sun, 25 Jun 2023 11:34:52 +0800
> > > 
> > > Use current logging style.
> > > 
> > > Link: https://lkml.kernel.org/r/20230625033452.GA22858@didi-ThinkCentre-M930t-N000
> > > Signed-off-by: tiozhang <tiozhang@xxxxxxxxxxxxxx>
> > > Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> > > Cc: Joe Perches <joe@xxxxxxxxxxx>
> > > Cc: Kees Cook <keescook@xxxxxxxxxxxx>
> > > Cc: Luis Chamberlain <mcgrof@xxxxxxxxxx>
> > > Cc: Paulo Alcantara <pc@xxxxxx>
> > > Cc: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>
> > > Cc: Weiping Zhang <zwp10758@xxxxxxxxx>
> > > Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> > > ---
> > > 
> > >  kernel/cred.c |   27 +++++++++++++++------------
> > >  1 file changed, 15 insertions(+), 12 deletions(-)
> > > 
> > > --- a/kernel/cred.c~cred-convert-printks-to-pr_level
> > > +++ a/kernel/cred.c
> > > @@ -4,6 +4,9 @@
> > >   * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
> > >   * Written by David Howells (dhowells@xxxxxxxxxx)
> > >   */
> > > +
> > > +#define pr_fmt(fmt) "CRED: " fmt
> > 
> > My preference would be to use
> > 
> > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > 
> > but it likely doesn't matter too much.
> 
> The patch as-is keeps the messages identical to before, so it should
> probably stay this way.

Generally these message prefixes are lowercase and the
dmesg output is not guaranteed to be stable.

One day it'd be trivially useful to standardize the
output style of pr_<foo> uses and remove the typical
pr_fmt defines and only use a define in exceptional cases

$ git grep -Ph 'define\s+pr_fmt\(' | \
  sed -r 's/\s+/ /g' | \
  sort | uniq -c | sort -rn | head -10
   1280 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
    145 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
     37 #define pr_fmt(fmt) "%s: " fmt, __func__
     22 #define pr_fmt(fmt) "ACPI: " fmt
     21 #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
     19 #define pr_fmt(fmt) fmt
     17 #define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
     14 #define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
     13 #define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt
     12 #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux