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