Commit Graph

11 Commits

Author SHA1 Message Date
Sreenath Vijayan 1b743485e2 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>
2024-04-11 14:22:52 +02:00
Tomas Mudrunka 39ff20f5fd /proc/sysrq-trigger: accept multiple keys at once
This way we can do:
`echo _reisub > /proc/sysrq-trigger`
Instead of:
`for i in r e i s u b; do echo "$i" > /proc/sysrq-trigger; done;`

This can be very useful when trying to execute sysrq combo remotely
or from userspace. When sending keys in multiple separate writes,
userspace (eg. bash or ssh) can be killed before whole combo is completed.
Therefore putting all keys in single write is more robust approach.

Signed-off-by: Tomas Mudrunka <tomas.mudrunka@gmail.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20231120111451.527952-1-tomas.mudrunka@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-25 07:23:16 +00:00
Randy Dunlap dbeb56fe80 Documentation: admin-guide: correct spelling
Correct spelling problems for Documentation/admin-guide/ as reported
by codespell.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Mukesh Ojha <quic_mojha@quicinc.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Zefan Li <lizefan.x@bytedance.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: cgroups@vger.kernel.org
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Mike Snitzer <snitzer@kernel.org>
Cc: dm-devel@redhat.com
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org
Cc: linux-mm@kvack.org
Link: https://lore.kernel.org/r/20230129231053.20863-2-rdunlap@infradead.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2023-02-02 11:04:42 -07:00
Cengiz Can f1285c68e1 Documentation: sysrq: convert to third person
Two parts of the sysrq documentation have sentences written from a first
person's point of view.

Documentation is generally written from a third person's view in a
formal way.

Convert those senteces to be less personal and generic.

Signed-off-by: Cengiz Can <cengiz@kernel.wtf>
Link: https://lore.kernel.org/r/20210629141508.52229-1-cengiz@kernel.wtf
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2021-07-15 06:33:44 -06:00
Gao Xiang a8f2a68e42 Documentation: sysrq: update description about sysrq crash
After commit 8341f2f222 ("sysrq: Use panic() to force a crash"),
a crash was not generated by dereferencing a NULL pointer anymore.

Let's update documentation as well to make it less misleading.

Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Cc: Matthias Kaehlcke <mka@chromium.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Zefan Li <lizefan.x@bytedance.com>
Link: https://lore.kernel.org/r/20210309191550.3955601-1-hsiangkao@redhat.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2021-03-15 14:23:21 -06:00
Andrzej Pietrasiewicz a27eb0cb4b tty/sysrq: Extend the sysrq_key_table to cover capital letters
All slots in sysrq_key_table[] are either used, reserved or at least
commented with their intended use. This patch adds capital letter versions
available, which means adding 26 more entries.

For already existing SysRq operations the user presses Alt-SysRq-<key>, and
for the newly added ones Alt-Shift-SysRq-<key>.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://lore.kernel.org/r/20200818112825.6445-2-andrzej.p@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-02 14:56:06 +02:00
Emil Velikov 23cbedf812 tty/sysrq: constify the sysrq API
The user is not supposed to thinker with the underlying sysrq_key_op.
Make that explicit by adding a handful of const notations.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://lore.kernel.org/r/20200513214351.2138580-2-emil.l.velikov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15 14:53:19 +02:00
Alyssa Ross 8699039042 Documentation: sysrq: fix RST formatting
"On x86" and "On SPARC" are now definition list terms, like
"On PowerPC", "On other", and "On all".

The Credits list is now a bulleted list, like lots of Credits lists in
other files.  This prevents the list from becoming a single long,
unpunctuated sentence in the generated documentation.

I also did a couple of other tiny readability improvements to the
"How do I use the magic SysRq key?" section while I was there.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Link: https://lore.kernel.org/r/20200403170701.10852-1-hi@alyssa.is
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2020-04-07 13:32:15 -06:00
Adam Borowski 209c3aa7f0 Documentation: sysrq: don't recommend 'S' 'U' before 'B'
This advice is obsolete and slightly harmful for filesystems from this
millenium: any modern filesystem can handle unexpected crashes without
requiring fsck -- and on the other hand, trying to write to the disk when
the kernel is in a bad state risks introducing corruption.

For ext2, any unsafe shutdown meant widespread breakage, but it's no longer
a reasonable filesystem for any non-special use.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2019-09-06 08:42:52 -06:00
Martin Kepplinger 30e010f64a Documentation: admin-guide: fix path to input key definitions
The UAPI header split failed to update the documentation here; fix things
accordingly.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2017-03-13 17:15:30 -06:00
Mauro Carvalho Chehab 9d85025b04 docs-rst: create an user's manual book
Place README, REPORTING-BUGS, SecurityBugs and kernel-parameters
on an user's manual book.

As we'll be numbering the user's manual, remove the manual
numbering from SecurityBugs.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-24 08:12:35 -02:00