Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4059804pxb; Tue, 26 Jan 2021 11:16:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfuwyZZGviiVtpgfT1heSwraazcEPAw8toodO/AOG+rE5w/UywBvh7GC+KuYh7+Epy9ICT X-Received: by 2002:a17:907:20a7:: with SMTP id pw7mr4417670ejb.283.1611688578113; Tue, 26 Jan 2021 11:16:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611688578; cv=none; d=google.com; s=arc-20160816; b=s1x9ZVxhKU9hspssi0RqjZkAdlmKmGCXke7aSg0J4GVTZItu+3zCjGb0SLlILmNUcQ fGkhHzHWAQO7Adh+So37zvrP/Hdb7LpuJsuk/iFC9mxoGnYkpVY57HiWgIJUiVyOaP/K iCdbe+R2+P5U8fa9P5gvIN1iyt4YjwpbWlyJeMqUNsTbOAQdNn9/oWN2h6Kq9Lha9pBV +PFDzKKLQ5uJknhR45+T0Mh/3pvBN5a7a9UcI+g/LM+16uCY4Xz4T59p4xRlF2BiU5QB zVBAJd75Cbqz10PDizf91HX9heUwYHfZusN8J0+DPgCePmWWlSG9gwNzaXU75dRGKxNi KqTA== 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=5YK6DFaqohTa6HDs5iDB1M57OC14rv2e9fF8RM9nNKM=; b=oHJgAmqA3FLMzGsb1cQi+AzueRamURRBOplQV0j5SkxT/jCd6kqm0bo17ah7L4UAEE IBfsbMgpCy/E2Ky+VdhbOq6MzhkLXhLipVJUpNcO4xVmCsM3i43XdN9qrBf/UJAZbm/6 4CYBkN3jMP2c7TeFCUlMgcHVxRhubqHQ6haMxnQaUrSPm+n3VYROy2lxgFRM5P3Pk+vk sKNG6zmHCRatONSI8p+1+ht1ZTvREmWeQLVrhKCTZrzZ885iHL+XtxQzj6rlg0VyAwHK C5vzsT08IbsmrUWtIQgK9TrHBeZ28VuHJbT+rnQBrECJusJvXZAHS/PxJgMH/IILR+0r B0dw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t16si8828564edr.4.2021.01.26.11.15.50; Tue, 26 Jan 2021 11:16:18 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405958AbhAZOqq (ORCPT + 99 others); Tue, 26 Jan 2021 09:46:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:60180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405107AbhAZOqV (ORCPT ); Tue, 26 Jan 2021 09:46:21 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 786172251F; Tue, 26 Jan 2021 14:45:40 +0000 (UTC) Date: Tue, 26 Jan 2021 09:45:39 -0500 From: Steven Rostedt To: Viktor Rosendahl Cc: Joel Fernandes , , Ingo Molnar Subject: Re: [RFC PATCH 1/2] Use pause-on-trace with the latency tracers Message-ID: <20210126094539.4969c357@gandalf.local.home> In-Reply-To: <20210119164344.37500-2-Viktor.Rosendahl@bmw.de> References: <20210119164344.37500-1-Viktor.Rosendahl@bmw.de> <20210119164344.37500-2-Viktor.Rosendahl@bmw.de> 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: linux-kernel@vger.kernel.org Sorry for the late reply. On Tue, 19 Jan 2021 17:43:43 +0100 Viktor Rosendahl wrote: > Eaerlier, tracing was disabled when reading the trace file. This behavior > was changed with: > > commit 06e0a548bad0 ("tracing: Do not disable tracing when reading the > trace file"). > > This doesn't seem to work with the latency tracers. > > The above mentioned commit dit not only change the behavior but also added > an option to emulate the old behavior. The idea with this patch is to > enable this pause-on-trace option when the latency tracers are used. > > This is a workaround, perhaps it would be better to make the latency > tracers work without pausing but I am not sure how to do that, or even > how feasible it is without significant rework. I think this is a fine workaround. The latency tracers are rather "special" and some options just don't make sense for them. There's some things I wish I had done different with them, but we can't fix because of backward compatibility reasons. I'll take a look at these today. Thanks. -- Steve > > Signed-off-by: Viktor Rosendahl > --- > kernel/trace/trace_irqsoff.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c > index d06aab4dcbb8..6756379b661f 100644 > --- a/kernel/trace/trace_irqsoff.c > +++ b/kernel/trace/trace_irqsoff.c > @@ -562,6 +562,8 @@ static int __irqsoff_tracer_init(struct trace_array *tr) > /* non overwrite screws up the latency tracers */ > set_tracer_flag(tr, TRACE_ITER_OVERWRITE, 1); > set_tracer_flag(tr, TRACE_ITER_LATENCY_FMT, 1); > + /* without pause, we will produce garbage if another latency occurs */ > + set_tracer_flag(tr, TRACE_ITER_PAUSE_ON_TRACE, 1); > > tr->max_latency = 0; > irqsoff_trace = tr; > @@ -583,11 +585,13 @@ static void __irqsoff_tracer_reset(struct trace_array *tr) > { > int lat_flag = save_flags & TRACE_ITER_LATENCY_FMT; > int overwrite_flag = save_flags & TRACE_ITER_OVERWRITE; > + int pause_flag = save_flags & TRACE_ITER_PAUSE_ON_TRACE; > > stop_irqsoff_tracer(tr, is_graph(tr)); > > set_tracer_flag(tr, TRACE_ITER_LATENCY_FMT, lat_flag); > set_tracer_flag(tr, TRACE_ITER_OVERWRITE, overwrite_flag); > + set_tracer_flag(tr, TRACE_ITER_PAUSE_ON_TRACE, pause_flag); > ftrace_reset_array_ops(tr); > > irqsoff_busy = false;