From patchwork Wed Nov 30 18:19:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Bristot de Oliveira X-Patchwork-Id: 27952 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1081281wrr; Wed, 30 Nov 2022 10:22:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf5t21hAErgu7zFMVrEPGQ1o5iPYPcBjfKKykk449f6zZYXM9GtzPmMj58yFTQVEn8B4oTkQ X-Received: by 2002:a17:906:f6c6:b0:78d:b367:20c1 with SMTP id jo6-20020a170906f6c600b0078db36720c1mr50256675ejb.530.1669832564433; Wed, 30 Nov 2022 10:22:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669832564; cv=none; d=google.com; s=arc-20160816; b=to+qgZ4GDs2bAupl87OwKgxdW+Lye+0aoSGhSiXPiHCP62tH6Idj89pYELbcYGXqmJ cKKt9gfoBvuLqq1oobHgH1GVIJJy1Ys7PISB5NrWl0rD2FE5hX9ccq/pFGAJa2L3hci3 /o3Wm1mq0yShZSar2UgzcWw1ppL67JUXhexMuDrFUibe3Pqis/5CycyOpnzkTfSgWrLw KYQms3ZQq4rFgUzNhIaoaEjsGUz6Hks6A11jY/j++zv2BLsEgqr/Cac/3Zkm7GEEjlCE +8yXye7GYZTrhZ+ImEciOinO7xk4ujo7YWp6wSWA0j++LQ7XlVBRd5kgZvZHg0Pg0N85 2TOA== 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:date:subject:cc:to:from :dkim-signature; bh=aWg9iCmVtcgU19BjwQr7qHc7qmpPSCGL2/gExDLvHZM=; b=tEmsCmFS8SVUK9rY4+52bP59XEhBi8DEYmX+jmooFcGniYnTCLirzd0Fj6hU2GlU5h LNxGGxoz5A08FGX9tWp2bib/YkfRmIEgqxSL7pKLLtTKpAbJNfD2o5EUS7AjckatxW81 ZbY/s/vso8K//vyfSXXI35TOVf8Zq+WL6UHwFp6rKRlz/1q6LnYOpkjaofb3KWW+KBwU JNXb5zePSXGsYvpBFT6AcoQXe+BIZBDDscE+xeYeCGuAKOEFIb4W+RiBNRGjm3RYN+jn ffmsgPJ5YnmYrcabXhWCNA55nHLqwO/NUI01k2eMiDCKWaD4ULYv5YN+Io9UmVexbtRQ Y76w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XMMfsAce; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l2-20020aa7c302000000b0046840ac2af1si1802310edq.68.2022.11.30.10.22.19; Wed, 30 Nov 2022 10:22:44 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XMMfsAce; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230053AbiK3SV2 (ORCPT + 99 others); Wed, 30 Nov 2022 13:21:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230314AbiK3SUt (ORCPT ); Wed, 30 Nov 2022 13:20:49 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F0638BD06; Wed, 30 Nov 2022 10:19:23 -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 sin.source.kernel.org (Postfix) with ESMTPS id 83F78CE1ACD; Wed, 30 Nov 2022 18:19:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8EEAC43470; Wed, 30 Nov 2022 18:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669832359; bh=UofQ2Om5TKKPZw19SG+8wKH8TntN+ojXWrOiFhpkAis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XMMfsAceNIPA7SVzZd9xgHyYxzJcdYfpp9vfAK/FLUt8535HDUNnn3noVhN0M1G7D fOMtP0q8tDdeTome2UAGMdiwTGteRyuhJ/O2bVmzXbM0PSLpkxQi6dcyFtfbdSnAF5 T/fSXL441rkM7QD9tGFQ0Pv/NuvtEADFGpvnH5mAXk1e/tXMvzo59uqxCdeBZiffRR 1clWQTueMTNBqloHGE0Ccpkeb2q/I0fUXWfwE1lUrzokBPy7xzu2zPxL8i/fTaNPPl xDVxNl8T4GNj0smUjuAmWKwPP4nyd1S5NYxABS3Yol1YqMkbnl2MsTxbTV5b4fjkDo PomzbCOX1HSDQ== From: Daniel Bristot de Oliveira To: Daniel Bristot de Oliveira , Steven Rostedt Cc: Masami Hiramatsu , Jonathan Corbet , Juri Lelli , Clark Williams , Bagas Sanjaya , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V4 1/3] tracing/osnoise: Add PANIC_ON_STOP option Date: Wed, 30 Nov 2022 19:19:09 +0100 Message-Id: <249ce4287c6725543e6db845a6e0df621dc67db5.1669832184.git.bristot@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750946351385714681?= X-GMAIL-MSGID: =?utf-8?q?1750946351385714681?= 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. Cc: Juri Lelli Cc: Daniel Bristot de Oliveira Cc: Steven Rostedt Cc: Masami Hiramatsu Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira --- 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 3f10dd1f2f1c..801eba0b5cf8 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 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(); From patchwork Wed Nov 30 18:19:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Bristot de Oliveira X-Patchwork-Id: 27951 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1081237wrr; Wed, 30 Nov 2022 10:22:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf6iDGUra+aHSq/Ny9uOMS3NaBcLXow49c4YJK6bMj7dvjKUFde/3LyAIlCNmHJoN+2X74bx X-Received: by 2002:a17:906:d1c7:b0:7ad:fd3e:7762 with SMTP id bs7-20020a170906d1c700b007adfd3e7762mr38562264ejb.717.1669832557501; Wed, 30 Nov 2022 10:22:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669832557; cv=none; d=google.com; s=arc-20160816; b=WyrrDpym2ggkE/R1cHxDlUUDVWVnsjlJlku/WYoVbjoBL4jVBO1Dn8Akd1JFvjemoW baIU74rBH6YmLsNz3fm188TycWVPAks8K0J4hDP5eVWZA1KjAgcHoBBbFkSXBjtkH6xa 2SZf5XiqDmvqbRodJF7Wz/imGEV3YTjBgF0fHCGMz5j2QTbpQVKBMBoJyDDfn6u5RNYa oNtYRHrzgu4GTq3ds5JTTPR4BvFUPy2eATseiiFI2qot8zUJir6r8dEufvyguXeHCBqN M/f0FTBcWcfqi0D90pXjsEwnzovULDHoZPzZMVK4U5bWVo7mxTdj+qkz1FQVHc8qsyWv ThIA== 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:date:subject:cc:to:from :dkim-signature; bh=CrCE6/+jo/dOOiWNIqaDjwl0gkmLXWk/HSiYsdMiEmM=; b=j1zDHTBG7NKYC9XYb52qD4//XIl7m2LmDbbJ5bIVwjOGFE5nsMhVTtywd0lyKSnMBv zeCMiXmMkN1e41giJ9agxCniY/j/x1O8JmEGPuyWhCwK1EwfIbYQwGNRhNyYGcfctx8E SdLjggOUKrrjFydgpT5ANVQSWxjYi4trvprvIXVJZaPLMLalDqT0SUFBXbhAHivTROWj IphPwp/Cw4cZoNynq7IASAFAgbVnF7gNJiPcDIfeBp6ZsdvY+Mdu15dyXVZicDlGUkp/ hnGXaf9bO3jjxHRNrK8249df3g71QUL1p1mzrvT2n/zkuNyz88zKiMzZJgDB11jpV14P ohxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r3K9eMn3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho38-20020a1709070ea600b007bf9de4fe91si2210426ejc.53.2022.11.30.10.22.11; Wed, 30 Nov 2022 10:22:37 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r3K9eMn3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230356AbiK3SVP (ORCPT + 99 others); Wed, 30 Nov 2022 13:21:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230288AbiK3SUt (ORCPT ); Wed, 30 Nov 2022 13:20:49 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36CBD1B1D2; Wed, 30 Nov 2022 10:19:23 -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 C448961B7C; Wed, 30 Nov 2022 18:19:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DB0BC433B5; Wed, 30 Nov 2022 18:19:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669832362; bh=GqkWc/aqvUjp4eNRfDmezwu0hcf18oKW1m9OVrE63ec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r3K9eMn3+BfW9qWvFSRyI9shOV4eHkdZD76u+7WzqrQBiOGLbHN0HCfjxJWd4R1RV ij2uIluG0XL/XVC95yexetf1y8mhtdrYvW1JQrFX0Uc+PKq1jGXCknM9CoQ50bKqdK q2PNR/ksD3N2NzWZbdt0xSiOgqekKtl+ATsqfoP08APGSuUBheLeLZt3KDozGJOdqF oWUKpS8nrlzngv4UX0tJoYeDT0emRidPWy/ecExywtXtMnnmZQARZZ4oaF+ORvThdM oscUKipdfHl5dwC/wvHpVzwakJvHdhpOixzA3K07Tkp3rIDEINkSnY3DenkY4+eHK9 vsDkCR6JEGW/g== From: Daniel Bristot de Oliveira To: Daniel Bristot de Oliveira , Steven Rostedt Cc: Masami Hiramatsu , Jonathan Corbet , Juri Lelli , Clark Williams , Bagas Sanjaya , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V4 2/3] tracing/osnoise: Add preempt and/or irq disabled options Date: Wed, 30 Nov 2022 19:19:10 +0100 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750946343378682964?= X-GMAIL-MSGID: =?utf-8?q?1750946343378682964?= The osnoise workload runs with preemption and IRQs enabled in such a way as to allow all sorts of noise to disturb osnoise's execution. hwlat tracer has a similar workload but works with irq disabled, allowing only NMIs and the hardware to generate noise. While thinking about adding an options file to hwlat tracer to allow the system to panic, and other features I was thinking to add, like having a tracepoint at each noise detection, it came to my mind that is easier to make osnoise and also do hardware latency detection than making hwlat "feature compatible" with osnoise. Other points are: - osnoise already has an independent cpu file. - osnoise has a more intuitive interface, e.g., runtime/period vs. window/width (and people often need help remembering what it is). - osnoise: tracepoints - osnoise stop options - osnoise options file itself Moreover, the user-space side (in rtla) is simplified by reusing the existing osnoise code. Finally, people have been asking me about using osnoise for hw latency detection, and I have to explain that it was sufficient but not necessary. These options make it sufficient and necessary. Adding a Suggested-by Clark, as he often asked me about this possibility. Cc: Suggested-by: Clark Williams Cc: Daniel Bristot de Oliveira Cc: Steven Rostedt Cc: Masami Hiramatsu Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira --- kernel/trace/trace_osnoise.c | 48 ++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index 801eba0b5cf8..0ec8bb54180f 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -55,10 +55,17 @@ enum osnoise_options_index { OSN_DEFAULTS = 0, OSN_WORKLOAD, OSN_PANIC_ON_STOP, + OSN_PREEMPT_DISABLE, + OSN_IRQ_DISABLE, OSN_MAX }; -static const char * const osnoise_options_str[OSN_MAX] = { "DEFAULTS", "OSNOISE_WORKLOAD", "PANIC_ON_STOP" }; +static const char * const osnoise_options_str[OSN_MAX] = { + "DEFAULTS", + "OSNOISE_WORKLOAD", + "PANIC_ON_STOP", + "OSNOISE_PREEMPT_DISABLE", + "OSNOISE_IRQ_DISABLE" }; #define OSN_DEFAULT_OPTIONS 0x2 unsigned long osnoise_options = OSN_DEFAULT_OPTIONS; @@ -1308,6 +1315,7 @@ static void notify_new_max_latency(u64 latency) */ static int run_osnoise(void) { + bool irq_disable = test_bit(OSN_IRQ_DISABLE, &osnoise_options); struct osnoise_variables *osn_var = this_cpu_osn_var(); u64 start, sample, last_sample; u64 last_int_count, int_count; @@ -1315,11 +1323,18 @@ static int run_osnoise(void) s64 total, last_total = 0; struct osnoise_sample s; unsigned int threshold; + bool preempt_disable; u64 runtime, stop_in; u64 sum_noise = 0; int hw_count = 0; int ret = -1; + /* + * Disabling preemption is only required if IRQs are enabled, + * and the options is set on. + */ + preempt_disable = !irq_disable && test_bit(OSN_PREEMPT_DISABLE, &osnoise_options); + /* * Considers the current thread as the workload. */ @@ -1335,6 +1350,15 @@ static int run_osnoise(void) */ threshold = tracing_thresh ? : 5000; + /* + * Apply PREEMPT and IRQ disabled options. + */ + if (irq_disable) + local_irq_disable(); + + if (preempt_disable) + preempt_disable(); + /* * Make sure NMIs see sampling first */ @@ -1422,16 +1446,21 @@ static int run_osnoise(void) * cond_resched() */ if (IS_ENABLED(CONFIG_PREEMPT_RCU)) { - local_irq_disable(); + if (!irq_disable) + local_irq_disable(); + rcu_momentary_dyntick_idle(); - local_irq_enable(); + + if (!irq_disable) + local_irq_enable(); } /* * For the non-preemptive kernel config: let threads runs, if - * they so wish. + * they so wish, unless set not do to so. */ - cond_resched(); + if (!irq_disable && !preempt_disable) + cond_resched(); last_sample = sample; last_int_count = int_count; @@ -1450,6 +1479,15 @@ static int run_osnoise(void) */ barrier(); + /* + * Return to the preemptive state. + */ + if (preempt_disable) + preempt_enable(); + + if (irq_disable) + local_irq_enable(); + /* * Save noise info. */ From patchwork Wed Nov 30 18:35:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Bristot de Oliveira X-Patchwork-Id: 27954 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1087659wrr; Wed, 30 Nov 2022 10:36:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf66OFSRfj6HUDecUnmxO3re97Y0qqyF6Bp21Kmw9HHhliNeWuwGXV+5Z8G9e4sNUN0/LUwI X-Received: by 2002:a17:90a:6b03:b0:205:f921:90ff with SMTP id v3-20020a17090a6b0300b00205f92190ffmr72823101pjj.156.1669833408260; Wed, 30 Nov 2022 10:36:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669833408; cv=none; d=google.com; s=arc-20160816; b=aCU+FwjwnxsdPU2hj8G+I4KZ2JKqUGaGOBMdf/xz1zW9y15mXfJnVJZZVg53SRhL8U rrkjnq7UnZ7i75nrcLWRtHbL/GsM/me7feWFZBEluNOPbvgoSTZg3QStwt67RTTwQlZW P4GiHUfah68pliWvjB10TrZjVlbyZFodk9re4RwP5klRT7o2Be8aK1ocOUurP/EvI3M1 f5SXN5PaAgh6pcrcTfKoSowyFUThK7z0urZdo5HaoUle9wZ71h7CJsTMFPc4etSa4HSq yiBaHQnpzjjmx8iq7LehJn/aUrt/G6E+kpP0A1zHuDTArHbQmJAeK0tJ0Lfvhemkg7MM Rohw== 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:date:subject:cc:to:from :dkim-signature; bh=SuR4XrBDJ03a8zE65CtxOLuh82yJ5bsOg17DGuJZt8E=; b=ckQbnm7BDK0FrNI3phItjIvl65spFKAoM6AJD2kZ8s9MV8oknMgaJId66pZ9MZc4Eo 3q5PsTAWpFDf/WxlRTjnBNhIRTUDHaiKOq7itQfdIPOaA/LSCk5L6gbi35xP8VSih4kW l5Dz3hGECf2u/1/SUjnVoYoCHi3Hv07OBXG51hoIeifHacVzJs09B3ET6UEVsBH9qX3L dWKp04KGUynB2aZiEpTXQr1L52ruCUmXoE3lM3AObpJgXx9VEmym7eaS3yl5mqsZclRa Qbd1eiT8OVWrrR6kXXRBNIDuA5VXaKWqCumCTpFscwruN0kZ5wv89KykDcROLY/9CE9T DcMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XHDHym0f; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s21-20020a632c15000000b00477a3989772si2043929pgs.12.2022.11.30.10.36.35; Wed, 30 Nov 2022 10:36:48 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XHDHym0f; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230425AbiK3SgV (ORCPT + 99 others); Wed, 30 Nov 2022 13:36:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230389AbiK3SgA (ORCPT ); Wed, 30 Nov 2022 13:36:00 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA84598953; Wed, 30 Nov 2022 10:35:55 -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 ams.source.kernel.org (Postfix) with ESMTPS id 7AA2BB81C9C; Wed, 30 Nov 2022 18:35:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B5FEC43470; Wed, 30 Nov 2022 18:35:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669833353; bh=IvVRl4+fARp9XLGnHwE9fvcyF8luYUHd16dM9vMV/1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XHDHym0fw/am9a6O1+HkdUZhYjS/i9Ib8fXUEfx3TCvQVtbQnDv5q3TH4i8PNdTwU T3Ll1ycSOBJ5l1LAVtpaYW75hthJoCLP4hLQ4kyh4jmHjKqTKadniT7Qaf1yTVm93y OJnkhsy+zZwk7VUBtd9mueaQhsH+OPdSRgUx6dpeBhW5JLhg46Tj+VsUXRsb/TmbOm CrKISttzd85lp40AMkRx7BpYWArFGCSF7NyD1NZnnOrPzBu6Vq97QNh8RveZjBKRN1 L6LxCstxWJdTiYzuh9LEnu64SZLS7sggxGmn7mf9iglvHvo809ug6/csr6UukY19Gs UOdfbmKFJ44BA== From: Daniel Bristot de Oliveira To: Daniel Bristot de Oliveira , Steven Rostedt Cc: Masami Hiramatsu , Jonathan Corbet , Juri Lelli , Clark Williams , Bagas Sanjaya , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V4 3/3] Documentation/osnoise: Add osnoise/options documentation Date: Wed, 30 Nov 2022 19:35:42 +0100 Message-Id: <255d17a89bcd9ca8eef6931c0052b1a520e0b580.1669832184.git.bristot@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750947235702589515?= X-GMAIL-MSGID: =?utf-8?q?1750947235702589515?= Add the documentation about the osnoise/options file, the options, and some additional explanation about the OSNOISE_WORKLOAD option. Cc: Daniel Bristot de Oliveira Cc: Steven Rostedt Cc: Masami Hiramatsu Cc: Jonathan Corbet Cc: Bagas Sanjaya Signed-off-by: Daniel Bristot de Oliveira Reviewed-by: Bagas Sanjaya --- Documentation/trace/osnoise-tracer.rst | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Documentation/trace/osnoise-tracer.rst b/Documentation/trace/osnoise-tracer.rst index 3c675ed82b27..f2008e317223 100644 --- a/Documentation/trace/osnoise-tracer.rst +++ b/Documentation/trace/osnoise-tracer.rst @@ -92,8 +92,8 @@ Note that the example above shows a high number of HW noise samples. The reason being is that this sample was taken on a virtual machine, and the host interference is detected as a hardware interference. -Tracer options ---------------------- +Tracer Configuration +-------------------- The tracer has a set of options inside the osnoise directory, they are: @@ -115,6 +115,22 @@ The tracer has a set of options inside the osnoise directory, they are: NO_OSNOISE_WORKLOAD disables the OSNOISE_WORKLOAD option. The special DEAFAULTS option resets all options to the default value. +Tracer Options +-------------- + +The osnoise/options file exposes a set of on/off configuration options for +the osnoise tracer. These options are: + + - DEFAULTS: reset the options to the default value. + - OSNOISE_WORKLOAD: do not dispatch osnoise workload (see dedicated + section below). + - PANIC_ON_STOP: call panic() if the tracer stops. This option serves to + capture a vmcore. + - OSNOISE_PREEMPT_DISABLE: disable preemption while running the osnoise + workload, allowing only IRQ and hardware-related noise. + - OSNOISE_IRQ_DISABLE: disable IRQs while running the osnoise workload, + allowing only NMIs and hardware-related noise, like hwlat tracer. + Additional Tracing ------------------