Re: [PATCH 1/4] printk: Introduce per-console loglevel setting
From: Petr Mladek
Date: Wed Mar 20 2019 - 11:37:34 EST
On Thu 2019-03-14 23:12:49, Tetsuo Handa wrote:
> Petr Mladek wrote:
> > It might be even more straightforward when the per-console value
> > defines the effective console level. I mean the following semantic:
> >
> > + "console_loglevel" would define the default loglevel used
> > by consoles at runtime.
> >
> > + the per-console loglevel could override the default
> > console_loglevel.
> >
> > + We would need a custom handler for the sysctl "console_loglevel".
> > It would write the given value to the global console_loglevel
> > variable and for all already registered consoles (con->loglevel).
>
> But some functions change console_loglevel without sysctl (e.g.
> console_verbose() when reporting hung tasks and panic()). Should
> con->loglevel be changed (which might result in too much messages to
> slow consoles) when console_loglevel changes?
It is about the semantic. We either want to set a hard limit
for each console or we want to set per-console loglevel that
will get used in normal situations.
I prefer the 2nd semantic. IMHO, console_verbose() should be
used only in situations when people really want to see all
lines, for example, panic, sysrq output when the machine
looks deadlocked, ignore_loglevel is set. I believe that they
want to see them even on the slow consoles that are
there exactly for debugging these critical situations.
Best Regards,
Petr