From patchwork Tue Jun 13 22:07:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 107589 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp856345vqr; Tue, 13 Jun 2023 15:17:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ590jios0O0JNt7rpN4jFUDlawiOKYvwdYiRHlMBsLKUB8btfXGuhSf6RE/neCWMxUTA8ho X-Received: by 2002:a17:907:a01:b0:978:8ecd:fa6c with SMTP id bb1-20020a1709070a0100b009788ecdfa6cmr13679093ejc.34.1686694646535; Tue, 13 Jun 2023 15:17:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686694646; cv=none; d=google.com; s=arc-20160816; b=xnqGQ28IXMbSNx7Z8iISPPD5qf5ZalAmEyZ712Mi/rFqWgJOo0z/TqsOK8r2JaQ482 lkzQOIK0LggLsAU0ZUHeExi88TbmhTbvj3MozFKcbRTcUY3D/m/eKNv5I/4Gn7LYD1U7 vbLZhz+sfJY6+A7JecFPZCzfJlZjBLr4nn97C/JTzW1dWOJcy6d5wqmdDlvh4YcRGzX1 owFtNAcoBBNKNZ14nrh6F5q6NLIhqz3TuhHdGnKslMnWsYBpoxVIdqIQWLvH+Rg4rQ24 2Zk0/1jdHtwL5R7nuOTsUWuV2sBuFnE2Bl/HHKP1Eh9MVrGts9F5V8aaqZC3BuSrShRe 9s5A== 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=stwuPLjsKUHStT6lNN18nV6ZKOCb9x/2MYvafif7d9g=; b=TZGicU27R7+JBunZAH0TGHpl2h2UABX9AlxpR53n0J0K1RQpw2ygQqMdsevt+55+0d bDa8RYLLcvcWjFf6CZrowH0RwCR7Tgwfj4xTOT+P84s267TxHoCykz/DnmY+0X5lH1n3 WrfOyoMPWq3+gmg/2Obu5Fo8uiIzunV6XntbjRChNvZ1PzlUlIcfx94XCYyaK56zR3pa vcbYXsZ2AMFVxI81Vv7QMUPrTaOyKbHt7Lf57pRju830s6H90mRy7HUq61FOTNdpSXDF fJ7Q7wYKtJKET3nRrLmao4JwB3Jf9FeaHXRybL0SI94roHznPXE8zEooDPvQpvuXMoKp InFA== 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 y25-20020a17090629d900b0094f335b0660si6830300eje.185.2023.06.13.15.17.01; Tue, 13 Jun 2023 15:17: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; 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 S236464AbjFMWIi (ORCPT + 99 others); Tue, 13 Jun 2023 18:08:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232792AbjFMWIa (ORCPT ); Tue, 13 Jun 2023 18:08:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 922BE10E6 for ; Tue, 13 Jun 2023 15:08:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7AA3963B7D for ; Tue, 13 Jun 2023 22:08:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2A4DC433B6; Tue, 13 Jun 2023 22:08:25 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1q9CBc-000EFG-2Y; Tue, 13 Jun 2023 18:08:24 -0400 Message-ID: <20230613220824.617067894@goodmis.org> User-Agent: quilt/0.66 Date: Tue, 13 Jun 2023 18:07:57 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Daniel Bristot de Oliveira , William White , Jonathan Corbet , Juri Lelli Subject: [for-next][PATCH 07/11] rtla: Start the tracers after creating all instances References: <20230613220750.330146797@goodmis.org> MIME-Version: 1.0 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, T_SCC_BODY_TEXT_LINE 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?1768627525779287879?= X-GMAIL-MSGID: =?utf-8?q?1768627525779287879?= From: Daniel Bristot de Oliveira Group all start tracing after finishing creating all instances. The tracing instance starts first for the case of hitting a stop tracing while enabling other instances. The trace instance is the one with most valuable information. Link: https://lkml.kernel.org/r/67da7a703a56f75d7cd46568525145a65501a7e8.1686066600.git.bristot@kernel.org Cc: William White Cc: Jonathan Corbet Tested-by: Juri Lelli Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) --- tools/tracing/rtla/src/osnoise_hist.c | 14 +++++++++++--- tools/tracing/rtla/src/osnoise_top.c | 13 ++++++++++--- tools/tracing/rtla/src/timerlat_hist.c | 17 ++++++++++++----- tools/tracing/rtla/src/timerlat_top.c | 19 +++++++++++++------ 4 files changed, 46 insertions(+), 17 deletions(-) diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src/osnoise_hist.c index dfbcb5ca7ecb..8f81fa007364 100644 --- a/tools/tracing/rtla/src/osnoise_hist.c +++ b/tools/tracing/rtla/src/osnoise_hist.c @@ -870,8 +870,6 @@ int osnoise_hist_main(int argc, char *argv[]) } } - trace_instance_start(trace); - if (params->trace_output) { record = osnoise_init_trace_tool("osnoise"); if (!record) { @@ -885,9 +883,19 @@ int osnoise_hist_main(int argc, char *argv[]) goto out_hist; } - trace_instance_start(&record->trace); } + /* + * Start the tracer here, after having set all instances. + * + * Let the trace instance start first for the case of hitting a stop + * tracing while enabling other instances. The trace instance is the + * one with most valuable information. + */ + if (params->trace_output) + trace_instance_start(&record->trace); + trace_instance_start(trace); + tool->start_time = time(NULL); osnoise_hist_set_signals(params); diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/osnoise_top.c index 0833537bb2eb..85abba568faf 100644 --- a/tools/tracing/rtla/src/osnoise_top.c +++ b/tools/tracing/rtla/src/osnoise_top.c @@ -697,8 +697,6 @@ int osnoise_top_main(int argc, char **argv) } } - trace_instance_start(trace); - if (params->trace_output) { record = osnoise_init_trace_tool("osnoise"); if (!record) { @@ -711,9 +709,18 @@ int osnoise_top_main(int argc, char **argv) if (retval) goto out_top; } + } + /* + * Start the tracer here, after having set all instances. + * + * Let the trace instance start first for the case of hitting a stop + * tracing while enabling other instances. The trace instance is the + * one with most valuable information. + */ + if (params->trace_output) trace_instance_start(&record->trace); - } + trace_instance_start(trace); tool->start_time = time(NULL); osnoise_top_set_signals(params); diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/src/timerlat_hist.c index e720c8908906..f431cf43246c 100644 --- a/tools/tracing/rtla/src/timerlat_hist.c +++ b/tools/tracing/rtla/src/timerlat_hist.c @@ -922,8 +922,6 @@ int timerlat_hist_main(int argc, char *argv[]) } } - trace_instance_start(trace); - if (params->trace_output) { record = osnoise_init_trace_tool("timerlat"); if (!record) { @@ -936,8 +934,6 @@ int timerlat_hist_main(int argc, char *argv[]) if (retval) goto out_hist; } - - trace_instance_start(&record->trace); } if (!params->no_aa) { @@ -956,9 +952,20 @@ int timerlat_hist_main(int argc, char *argv[]) err_msg("Failed to enable timerlat tracer\n"); goto out_hist; } + } + /* + * Start the tracers here, after having set all instances. + * + * Let the trace instance start first for the case of hitting a stop + * tracing while enabling other instances. The trace instance is the + * one with most valuable information. + */ + if (params->trace_output) + trace_instance_start(&record->trace); + if (!params->no_aa) trace_instance_start(&aa->trace); - } + trace_instance_start(trace); tool->start_time = time(NULL); timerlat_hist_set_signals(params); diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src/timerlat_top.c index d6b5a382569e..02cff4948981 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -743,8 +743,6 @@ int timerlat_top_main(int argc, char *argv[]) } } - trace_instance_start(trace); - if (params->trace_output) { record = osnoise_init_trace_tool("timerlat"); if (!record) { @@ -757,8 +755,6 @@ int timerlat_top_main(int argc, char *argv[]) if (retval) goto out_top; } - - trace_instance_start(&record->trace); } if (!params->no_aa) { @@ -785,11 +781,22 @@ int timerlat_top_main(int argc, char *argv[]) err_msg("Failed to enable timerlat tracer\n"); goto out_top; } - - trace_instance_start(&aa->trace); } } + /* + * Start the tracers here, after having set all instances. + * + * Let the trace instance start first for the case of hitting a stop + * tracing while enabling other instances. The trace instance is the + * one with most valuable information. + */ + if (params->trace_output) + trace_instance_start(&record->trace); + if (!params->no_aa && aa != top) + trace_instance_start(&aa->trace); + trace_instance_start(trace); + top->start_time = time(NULL); timerlat_top_set_signals(params);