Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3705345rwb; Tue, 16 Aug 2022 07:31:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR5IDMb2A82G+bLAmVU1cYT5aDCGL1L6VyNL2v12IQYQgqJX3BY4/tSDUKfv654tgzL6/RQ4 X-Received: by 2002:a17:902:e788:b0:16e:f924:6e41 with SMTP id cp8-20020a170902e78800b0016ef9246e41mr22275777plb.69.1660660290493; Tue, 16 Aug 2022 07:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660660290; cv=none; d=google.com; s=arc-20160816; b=unyByfH/Y07rKICmau4Pcgy70B2ay3hgKg76AmESAsK1pq85GJXAWkbSYHjR/uWiIq HyEphBif/RO5ApmHrdbaaHV4YJ+ZE9d3UQxLnOE4l45+Z1SOKv6zwQfG9YGmVTqSS5ql ACdgdojlIPCqip4FeZOOzpgcRZ9yNYM1Qrxvd7M51c4CfBomhjybE/04+xnMdJriOgsn j1tUQHpDDldgPYe8QmOokguUMqeodWIDI0KEZPnMK3yxCWnZhext1cHcmxYiDGDwSA78 0Lsepo/vkFQVx7phES2UQ9EzcILOmuxM+PrWJ49hoKOZMQ0d/vJJ4t880Yz4HWXKoCda AuyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=whqCC+LTBTaORfWolOK/qoEUZqrZNaFgibg4X6HRWDY=; b=etnFnPUDk06YfoRpgjA+OvB8YL8eSNTVNtfTbCBKhjmJmX4/N6A/AqMskwTcTRE1C/ 3TpcKJRNR5ft3sp66vuuYrr1ekH82iLpsLi8gewz7wrbowtTEA/Sz6BO8S7XSufs83OX 1nj4BjpNL4w43JLrdzErJUW1hrA/L16l728Qti7rVSn8W27iQVW/wR9DCcjRDML48tyY jzs4GqFeFSsDlL9yWOZ5VZOHmkNEAVaG1cj90H1HTAqqzAwQY84LZgdgVW1R5a8A948l ix5FKFar7kWqzQ5CbhLas+4mWydOYynr1rdkXzduBR3xwuxvY5QNhWFl568eopRQjFoU qczw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 10-20020a630b0a000000b0041d7ab4e620si14193746pgl.866.2022.08.16.07.31.17; Tue, 16 Aug 2022 07:31:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235978AbiHPOOo (ORCPT + 99 others); Tue, 16 Aug 2022 10:14:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbiHPOOn (ORCPT ); Tue, 16 Aug 2022 10:14:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 834A2AFAF9; Tue, 16 Aug 2022 07:14:42 -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 1FB9561007; Tue, 16 Aug 2022 14:14:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 756B3C433C1; Tue, 16 Aug 2022 14:14:37 +0000 (UTC) Date: Tue, 16 Aug 2022 10:14:45 -0400 From: Steven Rostedt To: "Guilherme G. Piccoli" Cc: 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, stern@rowland.harvard.edu, 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: <20220816101445.184ebb7c@gandalf.local.home> In-Reply-To: <20220719195325.402745-9-gpiccoli@igalia.com> References: <20220719195325.402745-1-gpiccoli@igalia.com> <20220719195325.402745-9-gpiccoli@igalia.com> 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 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Jul 2022 16:53:21 -0300 "Guilherme G. Piccoli" wrote: Sorry for the late review, but this fell to the bottom of my queue :-/ > +/* > + * The idea is to execute the following die/panic callback early, in order > + * to avoid showing irrelevant information in the trace (like other panic > + * notifier functions); we are the 2nd to run, after hung_task/rcu_stall > + * warnings get disabled (to prevent potential log flooding). > + */ > +static int trace_die_panic_handler(struct notifier_block *self, > + unsigned long ev, void *unused) > +{ > + if (!ftrace_dump_on_oops) > + goto out; > + > + if (self == &trace_die_notifier && ev != DIE_OOPS) > + goto out; I really hate gotos that are not for clean ups. > + > + ftrace_dump(ftrace_dump_on_oops); > + > +out: > + return NOTIFY_DONE; > +} > + Just do: 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; } Thanks, Other than that, Acked-by: Steven Rostedt (Google) -- Steve