Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2305854pxa; Mon, 17 Aug 2020 06:35:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylJtE6f9lLhy6hioruWxtkACkseWKhqlTaD/EKkT0bu25iN3bj4535hIBumh/ECWhgMiq8 X-Received: by 2002:a50:fc0a:: with SMTP id i10mr15241220edr.5.1597671309876; Mon, 17 Aug 2020 06:35:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597671309; cv=none; d=google.com; s=arc-20160816; b=rhVVMN9gPjYq5RpHte4s/lWBu8d9p4JFI88TIhJmtLfRSMpu83CQYQsLgOXjsje6ZC LFWY/4lKqqar3qAkgYbFPBGSZqyODTtTtsqFmFSyF78CWD1uZN0d4+E4Xd3tvr2l2+I+ olYXNVwkgRjxRsOiXL51u76EJsZWjp6U1SUJIlsYF3KObwanKBy8CpKomgduGzK3HLET 8PQdwEqBmWAN7u4BcWiq20mgpLH+pavM0fiZtD6IO9fb25MM/9f9t6eDB6jawbkI1NSF GSTNM/uVVLlxGd0AbqjT3yrmEfzOHPXMDBeNvneAeHjSzWuFpFiGVHCcgMYI6TSiaU0P 9xag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=bAnn3toUwUCLGIV13WzG+A0OcJ+rocGxN8fWXgxBXxg=; b=s2ZP1hLRJWuttkCe4gIcjtpoI/18sVarjGz7RyOkG2WDq3FvSBFqGnKpJA3MwNjYQh GlFR98b5Q4nKFyaL2S9hbB0Ey8V3Nf81GB5ZMI702/0LekqO/9GR8kLFRooAtOE1+ed2 xVL5FvnoseT2sAmbTtSCe+vdsA+bpIlKsQWkBWZe0QGufbYMmZ9ndn+/yHHGJw31o7d4 GJEZBwDSwscBG2o6WRZR6yZpEgttBLB3l6idsVi1Thf3dBuNNjzDn4GD0RdQOLw9RaEw PZGrimdR94PUpNhN7tGgAb/nHGn03vuZ4ShUrdJAqL248huuUY3Xb/tnP7TgOVtKh1Hd 6G+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si11785864ejd.449.2020.08.17.06.34.46; Mon, 17 Aug 2020 06:35:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728421AbgHQNcK (ORCPT + 99 others); Mon, 17 Aug 2020 09:32:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728349AbgHQNcJ (ORCPT ); Mon, 17 Aug 2020 09:32:09 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25D47C061389; Mon, 17 Aug 2020 06:32:09 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id D1F48297BC1 Subject: Re: [PATCH 2/2] tty/sysrq: Add configurable handler to execute a compound action To: Jiri Slaby , linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Dmitry Torokhov , linux-input@vger.kernel.org, kernel@collabora.com References: <20200804162402.2087-1-andrzej.p@collabora.com> <20200804162402.2087-3-andrzej.p@collabora.com> <0280e30a-2e70-7d21-68a9-5a2c22d7f316@kernel.org> From: Andrzej Pietrasiewicz Message-ID: <5fc8d6df-ff33-1afd-5a83-d79d41e0fefc@collabora.com> Date: Mon, 17 Aug 2020 15:32:05 +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: <0280e30a-2e70-7d21-68a9-5a2c22d7f316@kernel.org> Content-Type: text/plain; charset=iso-8859-2; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiri, W dniu 12.08.2020 o?13:45, Jiri Slaby pisze: > On 04. 08. 20, 18:24, 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 > > I think I miss what's that good for, given I can do it one-by-one > without setting such strings anywhere (I usually want to do different > things on different kinds of crashes)? > The "REISUB" action is a common way of handling a bad situation, though, so having a shortcut for a common way is helpful, yet we are not forcing this particular action to happen when the 'C' sysrq is invoked and offer configurability instead. I addressed the comments you had with regard to the code in a v2 series. Regards, Andrzej