From patchwork Wed Mar 29 15:50:16 2023 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: 76682 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp517042vqo; Wed, 29 Mar 2023 09:00:31 -0700 (PDT) X-Google-Smtp-Source: AKy350YCEgeJ7JDbqdWfqZEuM61n0sDf/pHQiAqzX7QYzdUSNppBaQIKLk5152kFGVZ55iHIvcW8 X-Received: by 2002:a17:906:398b:b0:930:e9ee:c474 with SMTP id h11-20020a170906398b00b00930e9eec474mr20930479eje.54.1680105631725; Wed, 29 Mar 2023 09:00:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680105631; cv=none; d=google.com; s=arc-20160816; b=KlmZVT50Y7gxTTqRA7SqiUPXiZm42RhGcK2jxubiut8fp1/ABLWEjy0dwItp9pXuYv RNWsKCrfC+brCJmkFEBPjpd5R4nXY25cVfUgf+om6tu4ZZBC+dI76l3WXvkFHDAhDJQT UnEmHdDRPXRFoKf6laB3wc54lJPf+zuca8opwm6FcvdF34Jhm2iulk172lIx54Fi68gB 0OI8eQIEG73vzgID1CVh1bZmhuEDJVCCeJiVqPX0IpY8444iH+ySVJ4iu/X9VvqSv5Oj yNZlCAenB/RAL23lA6EEalsAEcc0o5hN0+QzMZ5U5SVJoCyqrhRnTkVsVzsRKjjY0NPZ t+zw== 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=0APDIEG3jhwbDHZ13V4s9Q6SowgbxiQqR1JSgT0zuNw=; b=ZrNjP2oucTTsv4yes6LSjzWKIdlRPdT7JYSC3K2Sp5GC87oZ/vXAtBUZLtEKQ8CJ6+ zZ2tKebqTKafM9TfVuz2+22vGPVR7Oi70rpSJTMXn0/ZFM8hKVEHBxlyqmGvkN1Q7ZHm XHa7dPsZJ92IipijsplOrBmQIb8U+o3Mi1ijHgo5yO3VWaC4nqYd86Vf4oypprkCPLUC QD0RFRwVG0fGD1a4QL7GcLvJxqbgAvCRCk+Q1ONUSDq//UbQOXMkiw+9bS03bbndKm7L ph+AgNYMuMOS2fvzYCk+JpGoUG4/Hs4eaf3Sk2Q+ddeV1GDvM92aUcVigInAdI680KnQ jfGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Styd9QyN; 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 ti12-20020a170907c20c00b0093e6f520acesi13068967ejc.832.2023.03.29.09.00.07; Wed, 29 Mar 2023 09:00:31 -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=Styd9QyN; 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 S230472AbjC2Puq (ORCPT + 99 others); Wed, 29 Mar 2023 11:50:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230314AbjC2Puc (ORCPT ); Wed, 29 Mar 2023 11:50:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0361F4EE2; Wed, 29 Mar 2023 08:50:32 -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 9257761D8F; Wed, 29 Mar 2023 15:50:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2FAFC4339B; Wed, 29 Mar 2023 15:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680105031; bh=LNmrHOHZSXL4IkLvbNsFQtsYFomPWDYEcws5TTYpK8Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Styd9QyNRsWH/KQJOV/szMtfVnNCxmZQHrQi44NB3kIkK5VPgUqYjIX8x3fhovfXW sLtRs/F3QkDUlqHxGLa5jH8w7o4EOMLP0tu3+UGsCJozJTFbpm9xo3gJd7vFSv/QYk KAc4dtE535l+P3aqpcmsxgQsGyCX8TXGiPVqATIJxAjJIHU2QGf/rvYcb+La75a7Rl cERP5PX441FRFY7yHRIOU3c6ZDdcJZT5oNdZF7yk6o3wyCtd9LaPHLCzGR7+S/kNdY HVrlispeR0n4Zq1Uwv7qLhcWIT48oAXUZRE52jbHNnLvaJXSXPFzw+FMAmQTok9hzA nETHrDudcOnaw== From: Daniel Bristot de Oliveira To: Steven Rostedt Cc: Daniel Bristot de Oliveira , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Masami Hiramatsu Subject: [PATCH V2 2/2] tracing/osnoise: Fix notify new tracing_max_latency Date: Wed, 29 Mar 2023 17:50:16 +0200 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: <16e18d61d69073d0192ace07bf61e405cca96e9c.1680104184.git.bristot@kernel.org> References: <16e18d61d69073d0192ace07bf61e405cca96e9c.1680104184.git.bristot@kernel.org> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761718442640470106?= X-GMAIL-MSGID: =?utf-8?q?1761718442640470106?= osnoise/timerlat tracers are 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 Cc: Steven Rostedt Cc: Masami Hiramatsu Signed-off-by: Daniel Bristot de Oliveira --- kernel/trace/trace_osnoise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index e8116094bed8..4496975f2029 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); }