[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZzNRJr21HiHXBAFO@pathway.suse.cz>
Date: Tue, 12 Nov 2024 13:59:18 +0100
From: Petr Mladek <pmladek@...e.com>
To: Chris Down <chris@...isdown.name>
Cc: linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>,
John Ogness <john.ogness@...utronix.de>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Tony Lindgren <tony.lindgren@...ux.intel.com>, kernel-team@...com
Subject: Re: [PATCH v6 04/11] printk: Support toggling per-console loglevel
via syslog() and cmdline
On Mon 2024-10-28 16:45:40, Chris Down wrote:
> A new module parameter (ignore_per_console_loglevel) is added, which can
> be set via the kernel command line or at runtime through
> /sys/module/printk/parameters/ignore_per_console_loglevel. When set, the
> per-console loglevels are ignored, and the global console loglevel
> (console_loglevel) is used for all consoles.
>
> During sysrq, we temporarily disable per-console loglevels to ensure all
> requisite messages are printed to the console. This is necessary because
> sysrq is often used in dire circumstances where access to
> /sys/class/console may not be trivially possible.
>
> Additionally, the syslog actions SYSLOG_ACTION_CONSOLE_ON and
> SYSLOG_ACTION_CONSOLE_OFF are augmented to save and restore the state of
> ignore_per_console_loglevel. This allows administrators to enable or
> disable per-console loglevels dynamically using the syslog() system
> call, as supported in userspace by things like dmesg.
>
> This is useful when debugging issues with message emission, or when
> needing to quickly break glass and revert to global loglevel only.
>
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -1298,6 +1313,16 @@ bool per_console_loglevel_is_set(const struct console *con)
> * 1. con->level. The locally set, console-specific loglevel. Optional, only
> * valid if >0.
> * 2. console_loglevel. The default global console loglevel, always present.
I think that I have suggested to remove the above comment because
it was obvious from the code. I am in doubts now because use
extendended it below ;-)
> + * The behaviour can be further changed by the following printk module
> + * parameters:
> + *
> + * 1. ignore_loglevel. Can be set at boot or at runtime with
> + * /sys/module/printk/parameters/ignore_loglevel. Overrides absolutely
> + * everything since it's used to debug.
> + * 2. ignore_per_console_loglevel. Existing per-console loglevel values are left
> + * intact, but are ignored in favour of console_loglevel as long as this is
> + * true. Also manipulated through syslog(SYSLOG_ACTION_CONSOLE_{ON,OFF}).
I like that it is summarized in one place. I like the comment after all ;-)
That said, it is also nicely summarized in
Documentation/admin-guide/per-console-loglevel.rst
So, it might be enough to mention it here.
> */
> enum loglevel_source
> console_effective_loglevel_source(const struct console *con)
Best Regards,
Petr
Powered by blists - more mailing lists