From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1B9BC47423 for ; Fri, 2 Oct 2020 13:42:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62AB220719 for ; Fri, 2 Oct 2020 13:42:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387896AbgJBNm6 (ORCPT ); Fri, 2 Oct 2020 09:42:58 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:49958 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726282AbgJBNm6 (ORCPT ); Fri, 2 Oct 2020 09:42:58 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 7E7E629DCF4 Subject: Re: [PATCH v3 2/2] tty/sysrq: Add configurable handler to execute a compound action To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jiri Slaby , Dmitry Torokhov , linux-input@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@collabora.com References: <20200818112825.6445-1-andrzej.p@collabora.com> <20200818112825.6445-3-andrzej.p@collabora.com> <20201002125429.GA3350322@kroah.com> From: Andrzej Pietrasiewicz Message-ID: Date: Fri, 2 Oct 2020 15:42:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201002125429.GA3350322@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, W dniu 02.10.2020 o 14:54, Greg Kroah-Hartman pisze: > On Tue, Aug 18, 2020 at 01:28:25PM +0200, Andrzej Pietrasiewicz wrote: >> 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 > > A macro language for sysrq commands, who would have thought... > > Anyway, _why_ would userland want to do something so crazy as this? > What is the use-case here? > A use-case is Chromebooks which do want to execute 'w', 's', wait 1000ms and then 'c' under one key combination. Having that supported upstream brings us one little step closer to those machines running upstream kernel. Another argument for such a "macro language" is when a machine's system keeps degrading over time, possibly degrading (relatively) fast. "Raising Elephants Is So Utterly Boring" consists of 6 actions, each of which requires pressing several keys. The user might be unable to complete all the 6 steps, while a "macro" requires user's involvement for carrying out just one step. Regards, Andrzej