Re: [RFC] printk: More consistent loglevel for continuous lines

From: Joe Perches
Date: Wed Nov 24 2021 - 20:48:11 EST


On Thu, 2021-11-25 at 09:53 +0900, Sergey Senozhatsky wrote:
> On (21/11/24 16:48), Petr Mladek wrote:
> >
> > Anyway, it looks a bit non-practical to update all existing pr_cont()
> > callers:
> >
> > $> git grep "pr_cont" | wc -l
> > 2054
>
> Another question is how many pr_cont()-s are getting compiled with
> the "average" production kernel config. A number of pr_cont() is in
> debugging code - lockdep, kasan, etc. - which is not compiled for prod.

This was Linus' attempt to make KERN_CONT meaningful again when it
was IMO a slightly different issue to fix bare printks.

Linus changed the few bare printks that mattered to him at the time.

So the existing bare printk's should also be inspected.

There are still many hundreds of those bare printks around.

$ git grep -P '\bprintk\s*\(\s*(?!KERN_[A-Z]+)\s*"' | wc -l
6863

But most all of those are in really old and effectively dead code.

To approximately answer to the question of how many pr_cont's and
bare printks are getting compiled in an x86-64 config:

$ make defconfig
$ make clean
$ make
$ find . -name '*.o' | sed 's/\.o$/\.c/' | \
xargs git grep -P '(\bprintk\s*\(\s*(?!KERN_[A-Z]+)|\bpr_cont\b|\bprintk\s*\(\s*KERN_CONT)' -- | \
wc -l
518