Re: [PATCH v4 2/2] tty/sysrq: Dump printk ring buffer messages via sysrq

From: John Ogness
Date: Mon Feb 26 2024 - 04:58:42 EST


On 2024-02-14, Sreenath Vijayan <sreenath.vijayan@xxxxxxxx> wrote:
> //in printk.c
> void console_replay_all(void)
> {
> if (console_trylock()) {
> __console_rewind_all();
> console_unlock();
> }
> }
>
> //in sysrq.c
> static void sysrq_handle_dmesg_dump(u8 key)
> {
> int orig_log_level = console_loglevel;
> console_loglevel = CONSOLE_LOGLEVEL_DEFAULT;
> console_replay_all();
> console_loglevel = orig_log_level;
> }

Note that there is already a sysrq 0-9 to change the loglevel. That may
be more appropriate.

John