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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60448C32774 for ; Tue, 16 Aug 2022 15:55:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232410AbiHPPzr (ORCPT ); Tue, 16 Aug 2022 11:55:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236315AbiHPPzX (ORCPT ); Tue, 16 Aug 2022 11:55:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CB7353D12; Tue, 16 Aug 2022 08:52:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 95E4B61219; Tue, 16 Aug 2022 15:52:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C43ABC433C1; Tue, 16 Aug 2022 15:52:41 +0000 (UTC) Date: Tue, 16 Aug 2022 11:52:49 -0400 From: Steven Rostedt To: Alan Stern Cc: "Guilherme G. Piccoli" , akpm@linux-foundation.org, bhe@redhat.com, pmladek@suse.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, x86@kernel.org, kernel-dev@igalia.com, kernel@gpiccoli.net, halves@canonical.com, fabiomirmar@gmail.com, alejandro.j.jimenez@oracle.com, andriy.shevchenko@linux.intel.com, arnd@arndb.de, bp@alien8.de, corbet@lwn.net, d.hatayama@jp.fujitsu.com, dave.hansen@linux.intel.com, dyoung@redhat.com, feng.tang@intel.com, gregkh@linuxfoundation.org, mikelley@microsoft.com, hidehiro.kawai.ez@hitachi.com, jgross@suse.com, john.ogness@linutronix.de, keescook@chromium.org, luto@kernel.org, mhiramat@kernel.org, mingo@redhat.com, paulmck@kernel.org, peterz@infradead.org, senozhatsky@chromium.org, tglx@linutronix.de, vgoyal@redhat.com, vkuznets@redhat.com, will@kernel.org, Sergei Shtylyov Subject: Re: [PATCH v2 08/13] tracing: Improve panic/die notifiers Message-ID: <20220816115249.66cf8f15@gandalf.local.home> In-Reply-To: References: <20220719195325.402745-1-gpiccoli@igalia.com> <20220719195325.402745-9-gpiccoli@igalia.com> <20220816101445.184ebb7c@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 16 Aug 2022 10:57:20 -0400 Alan Stern wrote: > > static int trace_die_panic_handler(struct notifier_block *self, > > unsigned long ev, void *unused) > > { > > if (!ftrace_dump_on_oops) > > return NOTIFY_DONE; > > > > /* The die notifier requires DIE_OOPS to trigger */ > > if (self == &trace_die_notifier && ev != DIE_OOPS) > > return NOTIFY_DONE; > > > > ftrace_dump(ftrace_dump_on_oops); > > > > return NOTIFY_DONE; > > } > > Or better yet: > > if (ftrace_dump_on_oops) { > > /* The die notifier requires DIE_OOPS to trigger */ > if (self != &trace_die_notifier || ev == DIE_OOPS) > ftrace_dump(ftrace_dump_on_oops); > } > return NOTIFY_DONE; > That may be more consolidated but less easy to read and follow. This is far from a fast path. As I maintain this bike-shed, I prefer the one I suggested ;-) -- Steve