Re: [PATCH 1/4] printk: Introduce per-console loglevel setting
From: Tetsuo Handa
Date: Thu Mar 14 2019 - 10:13:05 EST
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?
>
> The value will be used also for all newly registered consoles
> when they do not have any custom one.
>
>
> + The handler for "loglevel" early param should behave the same
> as the sysctl handler.
>
>
> IMHO, there is no perfect solution. The advantage of the above
> proposal is that you "see" and "use" exactly what you "set".