Re: [PATCH] printk: Add CONFIG_CONSOLE_LOGLEVEL_PANIC

From: Dmitry Safonov
Date: Mon Jun 28 2021 - 13:26:38 EST


On 6/28/21 1:43 PM, Petr Mladek wrote:
[..]
> Is it enough to keep the current level during panic()?

Yes.

> It might be
> easier to introduce a commandline option, for example, no_console_verbose_panic.
> It would do:
>
> static inline void console_verbose_panic(void)
> {
> if (!no_console_verbose_panic)
> console_verbose();
> }
>
> It is clear what it does. On the other hand, the logic with particular
> loglevels is not clear. 3 different proposals has already been mentioned
> in this thread:
>
> if (console_loglevel &&
> (CONFIG_CONSOLE_LOGLEVEL_PANIC > console_loglevel)) {
> console_loglevel = CONFIG_CONSOLE_LOGLEVEL_PANIC;
> }
>
> vs.
>
> if (console_loglevel)
> console_loglevel = CONFIG_CONSOLE_LOGLEVEL_PANIC;
>
> vs.
>
> if (console_loglevel && CONFIG_CONSOLE_LOGLEVEL_PANIC)
> console_loglevel = CONFIG_CONSOLE_LOGLEVEL_PANIC;
>
>
> Just imagine that you are a distributor, developer or admin:
>
> What value you would choose for CONFIG_CONSOLE_LOGLEVEL_PANIC?
> What console loglevel will be used at the end?
>
> The answer depends on the implemented alhorith, console_loglevel,
> and CONFIG_CONSOLE_LOGLEVEL_PANIC.
>
> The answer would be much easier if "no_verbose_console_panic" is
> used instead.

Thanks for your replies, Petr, I'll send v2 with the function rename
patch and a patch to introduce this boot option, after the merge window
closes. I appreciate your inputs :-)

Thanks,
Dmitry