Re: [RFC PATCH 3/3] watchdog: Turn console verbosity on when reporting softlockup

From: Sergey Senozhatsky
Date: Thu Mar 19 2020 - 04:02:04 EST


On (20/03/19 03:38), Valdis KlÄtnieks wrote:
> On Thu, 19 Mar 2020 15:48:36 +0900, Sergey Senozhatsky said:
>
> > So the issue is that when we bump `console_loglevel' or `ignore_loglevel'
> > we lift restrictions globally. For all CPUs, for all contexts which call
> > printk(). This may have negative impact. Fuzzing is one example. It
> > usually generates a lot of printk() noise, so lifting global printk()
> > log_level restrictions does cause problems. I recall that fuzzing people
> > really disliked the
> > old_level = console_loglevel
> > console_loglevel = new_level
> > ....
> > console_loglevel = old_level
> >
> > approach. Because if lets all CPUs and tasks to pollute serial logs.
> > While what we want is to print messages from a particular CPU/task.
>
> Well... how does this sound for a RFC idea? We already have CONFIG_PRINTK_TIME
> and CONFIG_PRINTK_CALLER. How about adding an option to allow printing the
> calling CPU as well, or just extend CALLER to print [pid/cpu] rather than just
> [pid]?

IIRC, CONFIG_PRINTK_CALLER prints pid when printk() caller is a
running task, and CPU-id otherwise.

It was added by fuzzing people, because it's almost (or "simply")
impossible to get through serial logs sometimes.

-ss