tty/sysrq: Replay kernel log messages on consoles via sysrq
authorSreenath Vijayan <sreenath.vijayan@sony.com>
Wed, 13 Mar 2024 10:22:52 +0000 (15:52 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Apr 2024 12:22:52 +0000 (14:22 +0200)
commit1b743485e27f3d874695434cc8103f557dfdf4b9
tree14b82b81d65986d60c3042316a322f6590c3cdff
parent693f75b91a9171e99f84fc193e39f48e21ba4a4f
tty/sysrq: Replay kernel log messages on consoles via sysrq

When terminal is unresponsive, one cannot use dmesg to view
the printk ring buffer messages. Also, syslog services may be
disabled, especially on embedded systems, to check the messages
after a reboot. In this scenario, replay the messages in printk
ring buffer on consoles via sysrq by pressing sysrq+R.

The console loglevel will determine which all kernel log messages
are displayed. The messages will be displayed only when
console_trylock() succeeds. Users could repeat the sysrq key when
it fails. If the owner of console subsystem lock is stuck,
repeating the key won't work.

Suggested-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Shimoyashiki Taichi <taichi.shimoyashiki@sony.com>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sreenath Vijayan <sreenath.vijayan@sony.com>
Link: https://lore.kernel.org/r/cc3b9b1aae60a236c6aed1dc7b0ffa2c7cd1f183.1710220326.git.sreenath.vijayan@sony.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/admin-guide/sysrq.rst
drivers/tty/sysrq.c