Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8400482rwl; Tue, 10 Jan 2023 13:03:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXt22h1D52ktVcCR18//Xn3Eo3isiCUTOw13t4D32A02h9L0B2qyS5rbMPaT8/L8b3B2TNC4 X-Received: by 2002:a17:90a:7343:b0:219:20b8:a6fe with SMTP id j3-20020a17090a734300b0021920b8a6femr72739275pjs.46.1673384604792; Tue, 10 Jan 2023 13:03:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673384604; cv=none; d=google.com; s=arc-20160816; b=VD/ZqJExTihCsvwvbdX+fak52RtPYw7kk0cpBarUjQ2IQa7pWZ5hxOsIKDVcU5sjei SE0HOC+auBTQ7aEnGYAXd8FqNcHRu6cg8JAYzhe4geB0T5jykUcKlvWx+XHEOYvKpahp c2GNkqZZgTkpJG6u+5xK57NI8gv5re0/Ojj0g9z4OshSA1irkb3VwumNrdE7EIgT+L/x mvnZxrB7XsUfd7OUrsied+w1JQ33SgdofR2I1uw/lJmH6QuXZDGFvhAxyaT5ivHM13SM MsaDxjGzx3MXDeyy2BomdOGHlj31Numdm2rCGKRC0WQju/3kLcBhTPYf6IuzB9PrQYCx mXvQ== 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=Tq+tp7MfJ6bblrEet5Hc9MeOIN8wYaJ4zf5BKLoOP20=; b=QWSw0Y9yS20PEST36myWcmki5fQsu+7RH1PWGwa8t3arMzwrBB7oVqXJkh6ClmUtaW hbQPKa+IBLBJ7Vj4Yx/Z0UWTXp+60Gb/7sjP0PQXr/IoVC1QL6dsAb3bfEUUtrXYMy2/ ocP3TxkV4ZU2u0q8oy0wpT2MNwqz0vSv+lrxLPks1pjTXCMf4SeDP/Dq72IPsH6gBCBu FyCtyz7f+Ck4kARC4lsjhNAvGvcrSdUQ0n9pQcBkeRiFSajk+DHmQKLAA/a2/ayZNCRP sIyhVq3LuMmMylRwOfmrlGm2dFKG6Qko7RL4axxPAomKLVaigZpA1V5ExY5s3mOjrSv7 scIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kNKbsIQ6; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r16-20020a632b10000000b004ad157c4692si11268021pgr.395.2023.01.10.13.03.17; Tue, 10 Jan 2023 13:03:24 -0800 (PST) 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=kNKbsIQ6; 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 S233362AbjAJUIp (ORCPT + 53 others); Tue, 10 Jan 2023 15:08:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232836AbjAJUIf (ORCPT ); Tue, 10 Jan 2023 15:08:35 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6314BC00; Tue, 10 Jan 2023 12:08:33 -0800 (PST) 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 72CAA61847; Tue, 10 Jan 2023 20:08:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7D0EC433D2; Tue, 10 Jan 2023 20:08:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673381312; bh=f7t2Tb6aVa91WI4iN6vlSINZLT/DS+dzcmYkQKr3WX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kNKbsIQ6YZeWN5FzIM2RJojjB2x0a8+x4jTs+VI8fluL3bcI4JYFpmN/tyK9tUNBE bKCfbge4hpWsOfBtw1Ft2qLZBWZ0jVLkVi8MlhLxQ7z7lhs4f+7jKdJJzm07D2qEZM v/hhAlH/qkXA1fDF3nOc3dsOcgNoAO/9AOusn22YkC+/ZCCmoJkPvbZdZwSpz2/PO8 ysLysdLkE1xUVAyAHEIvmLpT2Fi1nI95NDkLQ/FHljrsYnl5rpYWAkvNMWSP+wWRLz WPLt/OmB0926QNvurOYW+pT1vgQVwTcCWeuwS/BkuDYA30MQ5tdc+/xM1k0dXOOJhK ZwPxZ+6ONe6/Q== From: Daniel Bristot de Oliveira To: Daniel Bristot de Oliveira , Steven Rostedt , Jonathan Corbet Cc: Juri Lelli , Clark Williams , linux-trace-devel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] rtla/osnoise_top: Pass the params to the usage function Date: Tue, 10 Jan 2023 21:08:05 +0100 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 In preparation to the hwnoise tool, pass the osnoise top params to the usage function so it can be adapted according to the mode of the tool. Also make it static, as it is only used in this file. Signed-off-by: Daniel Bristot de Oliveira Cc: Daniel Bristot de Oliveira Cc: Steven Rostedt Cc: Jonathan Corbet --- tools/tracing/rtla/src/osnoise_top.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/osnoise_top.c index d7bbd73e1a78..fd2104050e3c 100644 --- a/tools/tracing/rtla/src/osnoise_top.c +++ b/tools/tracing/rtla/src/osnoise_top.c @@ -246,7 +246,7 @@ osnoise_print_stats(struct osnoise_top_params *params, struct osnoise_tool *top) /* * osnoise_top_usage - prints osnoise top usage message */ -void osnoise_top_usage(char *usage) +static void osnoise_top_usage(struct osnoise_top_params *params, char *usage) { int i; @@ -350,7 +350,7 @@ struct osnoise_top_params *osnoise_top_parse_args(int argc, char **argv) case 'c': retval = parse_cpu_list(optarg, ¶ms->monitored_cpus); if (retval) - osnoise_top_usage("\nInvalid -c cpu list\n"); + osnoise_top_usage(params, "\nInvalid -c cpu list\n"); params->cpus = optarg; break; case 'D': @@ -359,7 +359,7 @@ struct osnoise_top_params *osnoise_top_parse_args(int argc, char **argv) case 'd': params->duration = parse_seconds_duration(optarg); if (!params->duration) - osnoise_top_usage("Invalid -D duration\n"); + osnoise_top_usage(params, "Invalid -D duration\n"); break; case 'e': tevent = trace_event_alloc(optarg); @@ -375,17 +375,17 @@ struct osnoise_top_params *osnoise_top_parse_args(int argc, char **argv) break; case 'h': case '?': - osnoise_top_usage(NULL); + osnoise_top_usage(params, NULL); break; case 'p': params->period = get_llong_from_str(optarg); if (params->period > 10000000) - osnoise_top_usage("Period longer than 10 s\n"); + osnoise_top_usage(params, "Period longer than 10 s\n"); break; case 'P': retval = parse_prio(optarg, ¶ms->sched_param); if (retval == -1) - osnoise_top_usage("Invalid -P priority"); + osnoise_top_usage(params, "Invalid -P priority"); params->set_sched = 1; break; case 'q': @@ -394,7 +394,7 @@ struct osnoise_top_params *osnoise_top_parse_args(int argc, char **argv) case 'r': params->runtime = get_llong_from_str(optarg); if (params->runtime < 100) - osnoise_top_usage("Runtime shorter than 100 us\n"); + osnoise_top_usage(params, "Runtime shorter than 100 us\n"); break; case 's': params->stop_us = get_llong_from_str(optarg); @@ -420,7 +420,7 @@ struct osnoise_top_params *osnoise_top_parse_args(int argc, char **argv) exit(EXIT_FAILURE); } } else { - osnoise_top_usage("--trigger requires a previous -e\n"); + osnoise_top_usage(params, "--trigger requires a previous -e\n"); } break; case '1': /* filter */ @@ -431,11 +431,11 @@ struct osnoise_top_params *osnoise_top_parse_args(int argc, char **argv) exit(EXIT_FAILURE); } } else { - osnoise_top_usage("--filter requires a previous -e\n"); + osnoise_top_usage(params, "--filter requires a previous -e\n"); } break; default: - osnoise_top_usage("Invalid option"); + osnoise_top_usage(params, "Invalid option"); } } -- 2.38.1