Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp322006pxm; Wed, 2 Mar 2022 16:20:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHvUyHWB/hJpJTn2ssZJ18MAiH6eDZ6jiJFGk8g7DfXPhw34+VrTM4lK/XiYu0YdLx1kI/ X-Received: by 2002:a63:4b09:0:b0:372:c793:ab50 with SMTP id y9-20020a634b09000000b00372c793ab50mr27874468pga.495.1646266857072; Wed, 02 Mar 2022 16:20:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646266857; cv=none; d=google.com; s=arc-20160816; b=r1FnCqMZDQTbE7V8x08PsQ/5ZZcB2L/4G9zOvgvbX6UcFM3ZR9+iPUItRZxbnSzQW2 DxLpcdVgek+ImEMbdCTGsbDImIQYAhMrN68QFED/kKGM7x2GD8/6TWeoHahqxMLa7fWD UNn00xi+wPukc++OiKVAnWfi1/zFDpLJhix0V9gvgzeA8IP/0omBcPEQUeFX2iUqepzD 0IZ+aza8I9IdE733gHHBtX1RVuzKj2ZYF48Mf2S9y4lkNXGI3IWmjbl9u7gRuox93Oxg jsvpfPwDkoPQU7+6o0LnVcrlRhynuF1eJ96vGphBw0nbyTXi4ICzeD2Tjfa4boDqQj+P yYbg== 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; bh=HreST3qk8mrh4fs3+cZhiQxlgOQBzdiLy5kXiWYEsgg=; b=Cr2wT7nff5ABprmMxR3I5LFo5TB0vpWjrNKiEstEIvXKe4Fzbj5HAqf+c/tvTNvlpF nNU3dXkhNApNS0lzm1BR4t/WIVl/e/uJMnnegw9D8QsGr6zNFy41z2G1RIm3EjSz+qGr GKyzirEcAdYdTxoXIkR9EE2xDWbM7F5JjnvmyCnbFpscu42Vg5MwrqaNjv2F7w+hpKet MMrUfxvcOxHf/ZT9+ds8Vp5PIRb3lLFTMH0QVT+g065iKAL5AfgssHw4Bpuy2QnShWJ0 o/iWlH6Rq2lNEOF12YeGKdhGcFHhwxBO/kgK61e/JQiKIYVywJu23LJ3Wfh8DySWf6Q9 YfRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id z7-20020a170903018700b0014f329c7214si626235plg.249.2022.03.02.16.20.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 16:20:57 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BED121EF35A; Wed, 2 Mar 2022 15:34:07 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244908AbiCBTF1 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 2 Mar 2022 14:05:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244879AbiCBTFV (ORCPT ); Wed, 2 Mar 2022 14:05:21 -0500 Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [205.139.111.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 527F7C0845 for ; Wed, 2 Mar 2022 11:04:36 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-556-aG4RKoFBPGemeqfLWlHP9w-1; Wed, 02 Mar 2022 14:04:32 -0500 X-MC-Unique: aG4RKoFBPGemeqfLWlHP9w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 853BD501E3; Wed, 2 Mar 2022 19:04:30 +0000 (UTC) Received: from x1.com (unknown [10.22.32.168]) by smtp.corp.redhat.com (Postfix) with ESMTP id 941C719724; Wed, 2 Mar 2022 19:04:27 +0000 (UTC) From: Daniel Bristot de Oliveira To: Steven Rostedt Cc: Daniel Bristot de Oliveira , Jonathan Corbet , Clark Williams , Juri Lelli , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org, Changcheng Deng , Zeal Robot Subject: [PATCH V3 15/15] rtla: Tools main loop cleanup Date: Wed, 2 Mar 2022 20:01:40 +0100 Message-Id: <3c1642110aa87c396f5da4a037dabc72dbb9c601.1646247211.git.bristot@kernel.org> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=bristot@kernel.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset=WINDOWS-1252 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 I probably started using "do {} while();", but changed all but osnoise_top to "while(){};" leaving the ; behind. Cleanup the main loop code, making all tools use "while() {}" Changcheng Deng reported this problem, as reported by coccicheck: Fix the following coccicheck review: ./tools/tracing/rtla/src/timerlat_hist.c: 800: 2-3: Unneeded semicolon ./tools/tracing/rtla/src/osnoise_hist.c: 776: 2-3: Unneeded semicolon ./tools/tracing/rtla/src/timerlat_top.c: 596: 2-3: Unneeded semicolon Cc: Daniel Bristot de Oliveira Cc: Steven Rostedt Cc: Jonathan Corbet Reported-by: Changcheng Deng Reported-by: Zeal Robot Signed-off-by: Daniel Bristot de Oliveira --- tools/tracing/rtla/src/osnoise_hist.c | 2 +- tools/tracing/rtla/src/osnoise_top.c | 4 ++-- tools/tracing/rtla/src/timerlat_hist.c | 2 +- tools/tracing/rtla/src/timerlat_top.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src/osnoise_hist.c index c47780fedbaf..b4380d45cacd 100644 --- a/tools/tracing/rtla/src/osnoise_hist.c +++ b/tools/tracing/rtla/src/osnoise_hist.c @@ -850,7 +850,7 @@ int osnoise_hist_main(int argc, char *argv[]) if (trace_is_off(&tool->trace, &record->trace)) break; - }; + } osnoise_read_trace_hist(tool); diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/osnoise_top.c index fd29a4049322..72c2fd6ce005 100644 --- a/tools/tracing/rtla/src/osnoise_top.c +++ b/tools/tracing/rtla/src/osnoise_top.c @@ -612,7 +612,7 @@ int osnoise_top_main(int argc, char **argv) tool->start_time = time(NULL); osnoise_top_set_signals(params); - do { + while (!stop_tracing) { sleep(params->sleep_time); retval = tracefs_iterate_raw_events(trace->tep, @@ -632,7 +632,7 @@ int osnoise_top_main(int argc, char **argv) if (trace_is_off(&tool->trace, &record->trace)) break; - } while (!stop_tracing); + } osnoise_print_stats(params, tool); diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/src/timerlat_hist.c index 0f6ce80a198a..dc908126c610 100644 --- a/tools/tracing/rtla/src/timerlat_hist.c +++ b/tools/tracing/rtla/src/timerlat_hist.c @@ -885,7 +885,7 @@ int timerlat_hist_main(int argc, char *argv[]) if (trace_is_off(&tool->trace, &record->trace)) break; - }; + } timerlat_print_stats(params, tool); diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src/timerlat_top.c index 53f4cdfd395e..1f754c3df53f 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -680,7 +680,7 @@ int timerlat_top_main(int argc, char *argv[]) if (trace_is_off(&top->trace, &record->trace)) break; - }; + } timerlat_print_stats(params, top); -- 2.34.1