linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Add configurable handler to execute a compound action
@ 2020-08-04 16:24 Andrzej Pietrasiewicz
  2020-08-04 16:24 ` [PATCH 1/2] tty/sysrq: Extend the sysrq_key_table to cover capital letters Andrzej Pietrasiewicz
  2020-08-04 16:24 ` [PATCH 2/2] tty/sysrq: Add configurable handler to execute a compound action Andrzej Pietrasiewicz
  0 siblings, 2 replies; 8+ messages in thread
From: Andrzej Pietrasiewicz @ 2020-08-04 16:24 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Jiri Slaby, Dmitry Torokhov,
	Andrzej Pietrasiewicz, linux-input, kernel

Patch 2/2 adds a configurable handler to execute a compound action.

Userland might want to execute e.g. 'w' (show blocked tasks), followed
by 's' (sync), followed by 1000 ms delay and then followed by 'c' (crash)
upon a single magic SysRq. Or one might want to execute the famous "Raising
Elephants Is So Utterly Boring" action. This patch adds a configurable
handler, triggered with 'C', for this exact purpose. The user specifies the
composition of the compound action using syntax similar to getopt, where
each letter corresponds to an individual action and a colon followed by a
number corresponds to a delay of that many milliseconds, e.g.:

ws:1000c

or

r:100eis:1000ub

An example of userspace that wants to perform a compound action is
Chrome OS, where SysRq-X (pressed for the second time within a certain
time period from the first time) causes showing the locked tasks, syncing,
waiting a 1000 ms delay and crashing the system.

Since all the slots in the sysrq_key_table[] are already taken or reserved,
patch 1/2 extends it to cover also capital letter versions.

Andrzej Pietrasiewicz (2):
  tty/sysrq: Extend the sysrq_key_table to cover capital letters
  tty/sysrq: Add configurable handler to execute a compound action

 Documentation/admin-guide/sysrq.rst |  11 +++
 drivers/tty/sysrq.c                 | 128 +++++++++++++++++++++++++++-
 include/linux/sysrq.h               |   1 +
 3 files changed, 138 insertions(+), 2 deletions(-)


base-commit: bcf876870b95592b52519ed4aafcf9d95999bc9c
-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-29 22:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-04 16:24 [PATCH 0/2] Add configurable handler to execute a compound action Andrzej Pietrasiewicz
2020-08-04 16:24 ` [PATCH 1/2] tty/sysrq: Extend the sysrq_key_table to cover capital letters Andrzej Pietrasiewicz
2020-08-12 11:28   ` Jiri Slaby
2020-08-12 11:32   ` Jiri Slaby
2020-08-04 16:24 ` [PATCH 2/2] tty/sysrq: Add configurable handler to execute a compound action Andrzej Pietrasiewicz
2020-08-12 11:45   ` Jiri Slaby
2020-08-17 13:32     ` Andrzej Pietrasiewicz
2021-09-29 22:31   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).