mbox series

[v3,0/2] Add configurable handler to execute a compound action

Message ID 20200818112825.6445-1-andrzej.p@collabora.com (mailing list archive)
Headers show
Series Add configurable handler to execute a compound action | expand

Message

Andrzej Pietrasiewicz Aug. 18, 2020, 11:28 a.m. UTC
This is a follow-up of this thread:

https://www.spinics.net/lists/linux-input/msg68446.html

It only touches DRM (dri-devel) in such a way that it changes the help
message of sysrq_drm_fb_helper_restore_op, otherwise it is unrelated to DRM.

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.

v2..v3:
- eliminated compile error in !CONFIG_INPUT case (kernel test robot)

v1..v2:
- used toupper() instead of opencoding it (Jiri Slaby)
- updated help message of sysrq_drm_fb_helper_restore_op (Jiri Slaby)
- used unsigned int for specifying delays (Jiri Slaby)
- improved printed messages formatting (Jiri Slaby)

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/gpu/drm/drm_fb_helper.c     |   2 +-
 drivers/tty/sysrq.c                 | 129 +++++++++++++++++++++++++++-
 include/linux/sysrq.h               |   1 +
 4 files changed, 140 insertions(+), 3 deletions(-)


base-commit: 9123e3a74ec7b934a4a099e98af6a61c2f80bbf5

Comments

Greg KH Oct. 2, 2020, 12:31 p.m. UTC | #1
On Tue, Aug 18, 2020 at 01:28:23PM +0200, Andrzej Pietrasiewicz wrote:
> This is a follow-up of this thread:
> 
> https://www.spinics.net/lists/linux-input/msg68446.html

lore.kernel.org is easier to pull stuff from :)

Anyway, what ever happened to this series?  Is there a newer one
somewhere?

thanks,

greg k-h
Andrzej Pietrasiewicz Oct. 2, 2020, 12:33 p.m. UTC | #2
W dniu 02.10.2020 o 14:31, Greg Kroah-Hartman pisze:
> On Tue, Aug 18, 2020 at 01:28:23PM +0200, Andrzej Pietrasiewicz wrote:
>> This is a follow-up of this thread:
>>
>> https://www.spinics.net/lists/linux-input/msg68446.html
> 
> lore.kernel.org is easier to pull stuff from :)
> 
> Anyway, what ever happened to this series?  Is there a newer one
> somewhere?
> 
> thanks,
> 
> greg k-h
> 

https://lkml.org/lkml/2020/8/18/440

Andrzej
Andrzej Pietrasiewicz Oct. 2, 2020, 12:36 p.m. UTC | #3
W dniu 02.10.2020 o 14:33, Andrzej Pietrasiewicz pisze:
> W dniu 02.10.2020 o 14:31, Greg Kroah-Hartman pisze:
>> On Tue, Aug 18, 2020 at 01:28:23PM +0200, Andrzej Pietrasiewicz wrote:
>>> This is a follow-up of this thread:
>>>
>>> https://www.spinics.net/lists/linux-input/msg68446.html
>>
>> lore.kernel.org is easier to pull stuff from :)
>>
>> Anyway, what ever happened to this series?  Is there a newer one
>> somewhere?
>>
>> thanks,
>>
>> greg k-h
>>
> 
> https://lkml.org/lkml/2020/8/18/440
> 
> Andrzej

Sorry about confusion.

This is the same thing, so there is nothing newer.

Andrzej
Daniel Vetter Oct. 2, 2020, 12:45 p.m. UTC | #4
On Fri, Oct 02, 2020 at 02:36:33PM +0200, Andrzej Pietrasiewicz wrote:
> W dniu 02.10.2020 o 14:33, Andrzej Pietrasiewicz pisze:
> > W dniu 02.10.2020 o 14:31, Greg Kroah-Hartman pisze:
> > > On Tue, Aug 18, 2020 at 01:28:23PM +0200, Andrzej Pietrasiewicz wrote:
> > > > This is a follow-up of this thread:
> > > > 
> > > > https://www.spinics.net/lists/linux-input/msg68446.html
> > > 
> > > lore.kernel.org is easier to pull stuff from :)
> > > 
> > > Anyway, what ever happened to this series?  Is there a newer one
> > > somewhere?
> > > 
> > > thanks,
> > > 
> > > greg k-h
> > > 
> > 
> > https://lkml.org/lkml/2020/8/18/440
> > 
> > Andrzej
> 
> Sorry about confusion.
> 
> This is the same thing, so there is nothing newer.

Maybe split out the s/V/v/ in drm so I can pick that up? Alternatively
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> if Greg takes it all.

Cheers, Daniel
Greg KH Oct. 2, 2020, 12:55 p.m. UTC | #5
On Fri, Oct 02, 2020 at 02:45:29PM +0200, Daniel Vetter wrote:
> On Fri, Oct 02, 2020 at 02:36:33PM +0200, Andrzej Pietrasiewicz wrote:
> > W dniu 02.10.2020 o 14:33, Andrzej Pietrasiewicz pisze:
> > > W dniu 02.10.2020 o 14:31, Greg Kroah-Hartman pisze:
> > > > On Tue, Aug 18, 2020 at 01:28:23PM +0200, Andrzej Pietrasiewicz wrote:
> > > > > This is a follow-up of this thread:
> > > > > 
> > > > > https://www.spinics.net/lists/linux-input/msg68446.html
> > > > 
> > > > lore.kernel.org is easier to pull stuff from :)
> > > > 
> > > > Anyway, what ever happened to this series?  Is there a newer one
> > > > somewhere?
> > > > 
> > > > thanks,
> > > > 
> > > > greg k-h
> > > > 
> > > 
> > > https://lkml.org/lkml/2020/8/18/440
> > > 
> > > Andrzej
> > 
> > Sorry about confusion.
> > 
> > This is the same thing, so there is nothing newer.
> 
> Maybe split out the s/V/v/ in drm so I can pick that up? Alternatively
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> if Greg takes it all.

I'll take the first patch now, the second one is a bit more odd...

thanks for the ack.

greg k-h