Message ID | 20221210135826.783518244@goodmis.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1372690wrr; Sat, 10 Dec 2022 07:38:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ES5i+026E3hTVWFdycyJMuKxDEX0RljfFkkQoJnmbWNX/c7Ou4wbFMWul7gbWX9ebW4bH X-Received: by 2002:a05:6402:4514:b0:463:c4f5:ad1f with SMTP id ez20-20020a056402451400b00463c4f5ad1fmr7923889edb.11.1670681038371; Sat, 10 Dec 2022 06:03:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670681038; cv=none; d=google.com; s=arc-20160816; b=sxY6zFUOf/2wq2wQTT/BV+49HEkm16CKoTEgmktHKSUqhRcaf9SiHw4E6waN6F8lII bQ2zinBd6RsNzeWw505MX9yajtW5pvhDs6/MKMRIaF0td0KaPTZxBAbjMnGBvix5xo8x ql1HYR48/6ILxtO3d9wSDAeZd9rUum+25iYutB18AwclCWwuIDblq7NNXFb37jJr/frp kBZ7Z0Z+tuo/TH9icob0ffE4lnLWqTsA6uIxxH7VJSLvCE61yE0Z7HtOXAS4pz9NONSZ iiXpecC+VmN4pd8SiAAYEzzCGk93sRr/56nwZLfqta7owivHWPVNyVzAzlDEoQW51XFv 4hYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=U61VsGCDucx4kN4ImnFqmIEfTVhn8VMuEFxdv4vaS/A=; b=o6oP7KDYa/uWvmPPcRD+nk7EIwOcMUlYRlv6QSDfSsoPQE7UH1BJ7tEE89yzW7/CBU BH6s1IjPhz1x43nqDYhrIoM0GiAdCr6TrLrq6SNhfw5lmjRMNbyNxYZlmllIbtMoxfBP aX9bcXCKlLv/jco/cqMkx8kVlqpR3lXgB33FzKYFoVM4oLV3AkokF6bP1A6iGtn5iQYd Jxo7ITC1cmiqyR7tgILoKTYjvxbhtdWXfG46uAzCVjJMSXpHe2WC0iwiupqp2Xa6TE9O xwoEa6fDvaViqOfwyHLZCe/nigHwEUTC9t6e4wNtN+jDF6QUWybaGFIjkvOwT6ohSAZY RHSQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z7-20020a05640240c700b004619e210510si4506931edb.150.2022.12.10.06.03.35; Sat, 10 Dec 2022 06:03:58 -0800 (PST) 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 S230133AbiLJN7s (ORCPT <rfc822;jz.zhangjin@gmail.com> + 99 others); Sat, 10 Dec 2022 08:59:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229851AbiLJN63 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 10 Dec 2022 08:58:29 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E7E518E0A for <linux-kernel@vger.kernel.org>; Sat, 10 Dec 2022 05:58:28 -0800 (PST) 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 EDF6D60C2B for <linux-kernel@vger.kernel.org>; Sat, 10 Dec 2022 13:58:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5A47C433F0; Sat, 10 Dec 2022 13:58:27 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from <rostedt@goodmis.org>) id 1p40N0-000kvr-2y; Sat, 10 Dec 2022 08:58:26 -0500 Message-ID: <20221210135826.783518244@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 10 Dec 2022 08:58:13 -0500 From: Steven Rostedt <rostedt@goodmis.org> To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu <mhiramat@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Juri Lelli <juri.lelli@redhat.com>, Clark Williams <williams@redhat.com>, Bagas Sanjaya <bagasdotme@gmail.com>, Daniel Bristot de Oliveira <bristot@kernel.org>, Jonathan Corbet <corbet@lwn.net> Subject: [for-next][PATCH 23/25] tracing/osnoise: Add PANIC_ON_STOP option References: <20221210135750.425719934@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751836040730010577?= X-GMAIL-MSGID: =?utf-8?q?1751836040730010577?= |
Series |
tracing: Updates for 6.2
|
|
Commit Message
Steven Rostedt
Dec. 10, 2022, 1:58 p.m. UTC
From: Daniel Bristot de Oliveira <bristot@kernel.org> Often the latency observed in a CPU is not caused by the work being done in the CPU itself, but by work done on another CPU that causes the hardware to stall all CPUs. In this case, it is interesting to know what is happening on ALL CPUs, and the best way to do this is via crash dump analysis. Add the PANIC_ON_STOP option to osnoise/timerlat tracers. The default behavior is having this option off. When enabled by the user, the system will panic after hitting a stop tracing condition. This option was motivated by a real scenario that Juri Lelli and I were debugging. Link: https://lkml.kernel.org/r/249ce4287c6725543e6db845a6e0df621dc67db5.1670623111.git.bristot@kernel.org Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Clark Williams <williams@redhat.com> Cc: Bagas Sanjaya <bagasdotme@gmail.com> Cc: Daniel Bristot de Oliveira <bristot@kernel.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> --- kernel/trace/trace_osnoise.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index 8ba82c71268f..5a7613942223 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -54,10 +54,11 @@ enum osnoise_options_index { OSN_DEFAULTS = 0, OSN_WORKLOAD, + OSN_PANIC_ON_STOP, OSN_MAX }; -static const char * const osnoise_options_str[OSN_MAX] = { "DEFAULTS", "OSNOISE_WORKLOAD" }; +static const char * const osnoise_options_str[OSN_MAX] = { "DEFAULTS", "OSNOISE_WORKLOAD", "PANIC_ON_STOP" }; #define OSN_DEFAULT_OPTIONS 0x2 static unsigned long osnoise_options = OSN_DEFAULT_OPTIONS; @@ -1270,6 +1271,9 @@ static __always_inline void osnoise_stop_tracing(void) trace_array_printk_buf(tr->array_buffer.buffer, _THIS_IP_, "stop tracing hit on cpu %d\n", smp_processor_id()); + if (test_bit(OSN_PANIC_ON_STOP, &osnoise_options)) + panic("tracer hit stop condition on CPU %d\n", smp_processor_id()); + tracer_tracing_off(tr); } rcu_read_unlock();