Message ID | c22302a7db3cee6bcabf87462ed22a35dd38690f.1679675521.git.bristot@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp811927vqo; Fri, 24 Mar 2023 10:58:27 -0700 (PDT) X-Google-Smtp-Source: AKy350ZHkVY4+GSLoZGVXRXffMtBUC2TWO66d6AtiKN1tXTuKufhn5APNRyZrhBcsPSqNBc/uA0K X-Received: by 2002:a17:907:1c1e:b0:931:7c20:f75a with SMTP id nc30-20020a1709071c1e00b009317c20f75amr4687644ejc.53.1679680706979; Fri, 24 Mar 2023 10:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679680706; cv=none; d=google.com; s=arc-20160816; b=cY7XYIauwPxMg8dN4ljb3DpMDVvLKAQoVt40jd4nMX4MlQ6SRJDqW49DaYAIW5y80Y +depei3/jdNdamR2fKMSJNuniBr3rnzl1k2tHQfzlAI0dAaHmHtWhZtQAEfGK+YNJNvA ND/C7MBWKnZhbpGw8Z/2C0uAPWtFA3ZQfj9CIc/KgMfJ9EFK3MrwDeEblBfgfVxYTPlF jvJYf8qAGWPgLRBS/8yob29NGol5mqk6U5k7f0Bi4JpD1/fli1UB64tgBAMpELyVSnFp jsRpZqf3NRzaTbjpfLiIOBh3AMWU81zN6IXhQK9iYYQvRnXXtx9rcGy5KpTZSrRORUV0 pIvQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=ArxaOR5IkYjp+QMGY81ZosuPa/V6HfiKsdH3fIOVeRo=; b=YmQtRERyQu1VVqdhEYQYppxR0mbKOf8bHf556XrfS3qrjRE0odcKI5/mumF/ZWU8ic 0MntAegdzWh9Zpn534HN4G/SNooMhbWWSDVKUQcDNRtLQ0Wfun4Zk6AuULlsIWTELZXe Ukkcxe68fGlxxVyMYGf0q8z9D5TCtu6MFR7n0tF5BNIgUzjCqPnq8DaRKFODV2JvwQ7r rB7ukbC2dvZjBCKpc6DkUl4YMy22pwSSjjzuKByFyLhMaSLmZnEpGvoSMpGbEP4EjO6d Fb7YEMG9mgpO+ZwNOl4YrHg+Tkfc47N/LVSSy9BLuS1wI0Q7W7feUORPxKq4cxjW0kwp +u/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="L8bz/ayc"; 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 jy7-20020a170907762700b00932987332c3si16558031ejc.431.2023.03.24.10.57.36; Fri, 24 Mar 2023 10:58:26 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="L8bz/ayc"; 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 S232210AbjCXRwx (ORCPT <rfc822;makky5685@gmail.com> + 99 others); Fri, 24 Mar 2023 13:52:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231966AbjCXRwO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 24 Mar 2023 13:52:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36DA119681; Fri, 24 Mar 2023 10:51:50 -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 ams.source.kernel.org (Postfix) with ESMTPS id B0526B82593; Fri, 24 Mar 2023 17:51:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 370FBC433EF; Fri, 24 Mar 2023 17:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679680306; bh=VTt1KMunBj3bGgIvGPFs64aHDoVxlj73J1yqfBRjYOI=; h=From:To:Cc:Subject:Date:From; b=L8bz/aycpolR8IDhVvjHMD18pt8aeE/Uu4eq3zgOHzc9SeOgmFcKXaJmToDc7fsUR ysnPJ3bmtEqDllWZUMZhq4wDUa9qcCOlijXgP9OGaHhcbbFc35RrplYRqr8/od6Px1 ON0DL8R7mD0EooC6/K36gi6IfSVIgl2LPrsy0AGOMPIii0MOswuCgrkxr1JMKzX4PX oDU6IWk9jn6QE8lfbYbPAiTH0NSN6uJ/xSccP9FcQhblOUGS/aXePOwlWWwCXHtkTR JyndVN8X13KbjihpPPK691hHKedWwIUML9cg8hoc8eNxFskmdmIXjBUfbQp65n3/9D 2eAv2Kkecc+EQ== From: Daniel Bristot de Oliveira <bristot@kernel.org> To: Steven Rostedt <rostedt@goodmis.org> Cc: Daniel Bristot de Oliveira <bristot@kernel.org>, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Masami Hiramatsu <mhiramat@kernel.org> Subject: [PATCH] tracing/osnoise: Fix notify new tracing_max_latency Date: Fri, 24 Mar 2023 18:51:35 +0100 Message-Id: <c22302a7db3cee6bcabf87462ed22a35dd38690f.1679675521.git.bristot@kernel.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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?1761272876791245328?= X-GMAIL-MSGID: =?utf-8?q?1761272876791245328?= |
Series |
tracing/osnoise: Fix notify new tracing_max_latency
|
|
Commit Message
Daniel Bristot de Oliveira
March 24, 2023, 5:51 p.m. UTC
timerlat is not reporting a new tracing_max_latency for the thread
latency. Also, the tracer is reporting new max latency on instances
where the tracing is off, creating inconsistencies between the max
reported values in the trace and in the tracing_max_latency. Thus
only report new tracing_max_latency on active tracing instances.
Fixes: dae181349f1e ("tracing/osnoise: Support a list of trace_array *tr")
Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
---
kernel/trace/trace_osnoise.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
On Fri, 24 Mar 2023 18:51:35 +0100 Daniel Bristot de Oliveira <bristot@kernel.org> wrote: > timerlat is not reporting a new tracing_max_latency for the thread > latency. Also, the tracer is reporting new max latency on instances > where the tracing is off, creating inconsistencies between the max > reported values in the trace and in the tracing_max_latency. Thus > only report new tracing_max_latency on active tracing instances. Sounds to me this patch fixes two different bugs. If so, can you please break it up into two different patches? Thanks! -- Steve > > Fixes: dae181349f1e ("tracing/osnoise: Support a list of trace_array *tr") > Cc: Daniel Bristot de Oliveira <bristot@kernel.org> > Cc: Steven Rostedt <rostedt@goodmis.org> > Cc: Masami Hiramatsu <mhiramat@kernel.org> > Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org> > --- > kernel/trace/trace_osnoise.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c > index 210e1f168392..2a1b337ac643 100644 > --- a/kernel/trace/trace_osnoise.c > +++ b/kernel/trace/trace_osnoise.c > @@ -1296,7 +1296,7 @@ static void notify_new_max_latency(u64 latency) > rcu_read_lock(); > list_for_each_entry_rcu(inst, &osnoise_instances, list) { > tr = inst->tr; > - if (tr->max_latency < latency) { > + if (tracer_tracing_is_on(tr) && tr->max_latency < latency) { > tr->max_latency = latency; > latency_fsnotify(tr); > } > @@ -1738,6 +1738,8 @@ static int timerlat_main(void *data) > > trace_timerlat_sample(&s); > > + notify_new_max_latency(diff); > + > timerlat_dump_stack(time_to_us(diff)); > > tlat->tracing_thread = false;
On 3/29/23 01:16, Steven Rostedt wrote: > On Fri, 24 Mar 2023 18:51:35 +0100 > Daniel Bristot de Oliveira <bristot@kernel.org> wrote: > >> timerlat is not reporting a new tracing_max_latency for the thread >> latency. Also, the tracer is reporting new max latency on instances >> where the tracing is off, creating inconsistencies between the max >> reported values in the trace and in the tracing_max_latency. Thus >> only report new tracing_max_latency on active tracing instances. > > Sounds to me this patch fixes two different bugs. If so, can you please > break it up into two different patches? Yeah, I was dubious about sending one or two patches when I sent this one... But it makes sense making two of them... so I will do. Thanks! -- Daniel > Thanks! > > -- Steve > >> >> Fixes: dae181349f1e ("tracing/osnoise: Support a list of trace_array *tr") >> Cc: Daniel Bristot de Oliveira <bristot@kernel.org> >> Cc: Steven Rostedt <rostedt@goodmis.org> >> Cc: Masami Hiramatsu <mhiramat@kernel.org> >> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org> >> --- >> kernel/trace/trace_osnoise.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c >> index 210e1f168392..2a1b337ac643 100644 >> --- a/kernel/trace/trace_osnoise.c >> +++ b/kernel/trace/trace_osnoise.c >> @@ -1296,7 +1296,7 @@ static void notify_new_max_latency(u64 latency) >> rcu_read_lock(); >> list_for_each_entry_rcu(inst, &osnoise_instances, list) { >> tr = inst->tr; >> - if (tr->max_latency < latency) { >> + if (tracer_tracing_is_on(tr) && tr->max_latency < latency) { >> tr->max_latency = latency; >> latency_fsnotify(tr); >> } >> @@ -1738,6 +1738,8 @@ static int timerlat_main(void *data) >> >> trace_timerlat_sample(&s); >> >> + notify_new_max_latency(diff); >> + >> timerlat_dump_stack(time_to_us(diff)); >> >> tlat->tracing_thread = false; >
diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index 210e1f168392..2a1b337ac643 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -1296,7 +1296,7 @@ static void notify_new_max_latency(u64 latency) rcu_read_lock(); list_for_each_entry_rcu(inst, &osnoise_instances, list) { tr = inst->tr; - if (tr->max_latency < latency) { + if (tracer_tracing_is_on(tr) && tr->max_latency < latency) { tr->max_latency = latency; latency_fsnotify(tr); } @@ -1738,6 +1738,8 @@ static int timerlat_main(void *data) trace_timerlat_sample(&s); + notify_new_max_latency(diff); + timerlat_dump_stack(time_to_us(diff)); tlat->tracing_thread = false;