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

John Ogness
2024-02-26T09:28:36Z

On 2024-02-14, Sreenath Vijayan <sreenath.vijayan@sony.com> 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