From: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org,
Rob Herring <robh+dt@kernel.org>, Jiri Slaby <jslaby@suse.com>,
kernel@collabora.com
Subject: Re: [PATCH 6/6] tty/sysrq: Add configurable handler to execute a compound action
Date: Tue, 12 May 2020 11:15:59 +0200 [thread overview]
Message-ID: <e286f6ae-e4cb-ab13-c652-daf91fe1af7a@collabora.com> (raw)
In-Reply-To: <20200511182928.GV89269@dtor-ws>
Hi,
W dniu 11.05.2020 o 20:29, Dmitry Torokhov pisze:
> On Mon, May 11, 2020 at 06:21:13PM +0200, Greg Kroah-Hartman wrote:
>> On Mon, May 11, 2020 at 03:59:18PM +0200, Andrzej Pietrasiewicz wrote:
>>> Some 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
>>
>> Cute, but why? Who needs/wants this type of thing?
Surely things that can be done in userspace should be done there.
So we would envision an input daemon which reacts to a predefined
combination of keys. That said, it is not unimaginable to think of
userspace being dead enough (e.g. due to memory pressure) to be unable
to complete such a compound action. In other words userspace not being
able to do it is a good reason for putting the code in the kernel.
Dmitry has given a use case where such a compound action is needed.
Andrzej
>
> On Chrome OS the first time user presses SysRq-X it will try to kill
> chrome (and that will cause crash to get uploaded if user consented).
> The 2nd time within 5 seconds the same combo is pressed, it will dump
> blocked tasks in syslog and try to sync and then panic. On panic the
> device will reboot, logs will be scraped from pstore, and uploaded for
> analysis.
>
> Thanks.
>
prev parent reply other threads:[~2020-05-12 9:16 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-11 13:59 [PATCH 0/6] Magic SysRq extensions Andrzej Pietrasiewicz
2020-05-11 13:59 ` [PATCH 1/6] tty/sysrq: Remove linux,sysrq-reset-seq Andrzej Pietrasiewicz
2020-05-11 17:58 ` Dmitry Torokhov
2020-05-12 9:21 ` Andrzej Pietrasiewicz
2020-05-11 13:59 ` [PATCH 2/6] dt-bindings: input: Remove linux,sysrq-reset-seq binding Andrzej Pietrasiewicz
2020-05-11 13:59 ` [PATCH 3/6] tty/sysrq: Allow configurable SysRq key Andrzej Pietrasiewicz
2020-05-11 16:18 ` Greg Kroah-Hartman
2020-05-11 18:01 ` Dmitry Torokhov
2020-05-12 9:46 ` Andrzej Pietrasiewicz
2020-06-19 16:28 ` [PATCH] tty/sysrq: Add alternative " Andrzej Pietrasiewicz
2020-06-21 21:21 ` Pavel Machek
2020-06-26 11:07 ` Andrzej Pietrasiewicz
2020-06-22 6:24 ` Jiri Slaby
2020-06-26 11:51 ` Andrzej Pietrasiewicz
2020-07-09 5:05 ` Dmitry Torokhov
2020-07-09 8:15 ` Andrzej Pietrasiewicz
2020-05-11 13:59 ` [PATCH 4/6] tty/sysrq: Extend the sysrq_key_table to cover capital letters Andrzej Pietrasiewicz
2020-05-11 13:59 ` [PATCH 5/6] tty/sysrq: Add configurable handler to signal a process Andrzej Pietrasiewicz
2020-05-11 16:20 ` Greg Kroah-Hartman
2020-05-14 9:06 ` kbuild test robot
2020-05-11 13:59 ` [PATCH 6/6] tty/sysrq: Add configurable handler to execute a compound action Andrzej Pietrasiewicz
2020-05-11 16:21 ` Greg Kroah-Hartman
2020-05-11 18:29 ` Dmitry Torokhov
2020-05-12 9:15 ` Andrzej Pietrasiewicz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e286f6ae-e4cb-ab13-c652-daf91fe1af7a@collabora.com \
--to=andrzej.p@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=kernel@collabora.com \
--cc=linux-input@vger.kernel.org \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).