From nobody Tue Dec 2 02:05:05 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41E5D30DECB for ; Thu, 20 Nov 2025 23:26:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763681196; cv=none; b=UscOCpUwlUfYVfyMAAMqd9ahAbMzVtajQHarSaqym9A3SEHI4zP/eNUZXyAmYFwERkbCIj5gbkmJed2HsBN12aNOsFKkOWoRuE9lWzl3EEj+CgOZCfMv5Mz5lczdmnZhilXVParoB8pmTPb2Z/hjeWWJAxBHQv3gRqjpRCr3MOw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763681196; c=relaxed/simple; bh=thFEurTXI3V1gaKSo3B2txiSZow/SCmi7/SuHebeojo=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=BGTwjaQcyleEFhk5aJwgJ0leXe3Cj8seWQPJoGHgZM8Wc86kxuQ+1DphaxXV0Gat94QqGjZVGjdW4xyZ60rTCAxWNiPRbY2cNy68Sej6iNREQvYTs1to9t7K8Gst3tME9pglI/kzAQIT75RenmiZSnwL1ElrBsajbjYQhnpv48M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CRLac8F6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CRLac8F6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCF32C4CEF1; Thu, 20 Nov 2025 23:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763681195; bh=thFEurTXI3V1gaKSo3B2txiSZow/SCmi7/SuHebeojo=; h=Date:From:To:Cc:Subject:References:From; b=CRLac8F6YnqvGb8PKR0rx0VksYQGobItEf/yHiygQsjvt9bgxIOSYa8YIunwaumGV kONKCTvJX0UkW37X/D3UzesJk7sfxQRj8/dE9nQkxZ+6RHkGKa61KG7mylbD9/jInV SxSTtBEsg0RvljtbBgV2VpZSKiWp3liQ4Qa0VArzVGGMiIVkeOJB+1P/5gepU6tpnH g0xkRZclYMoTTts/HMnqWkeO/8qFqOY4nyoZIFmrIdJoXCkYx6r4yTu+wGUIFlaPeg 3vnZFsFE8+m0csBPLkE98wTKyAFXI5lIpzw3abcgy6BDE19ZIQ3tyCR493HPmTatlU YvT6awqi+YyBw== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1vME3Q-000000041uf-3u1e; Thu, 20 Nov 2025 18:27:08 -0500 Message-ID: <20251120232708.782719439@kernel.org> User-Agent: quilt/0.68 Date: Thu, 20 Nov 2025 18:23:32 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Costa Shulyupin Subject: [for-next][PATCH 09/16] tools/rtla: Replace timerlat_top_usage("...") with fatal("...") References: <20251120232323.271532418@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Costa Shulyupin A long time ago, when the usage help was short, it was a favor to the user to show it on error. Now that the usage help has become very long, it is too noisy to dump the complete help text for each typo after the error message itself. Replace timerlat_top_usage("...\n") with fatal("...") on errors. Remove the already unused 'usage' argument from timerlat_top_usage(). Signed-off-by: Costa Shulyupin Reviewed-by: Tomas Glozar Link: https://lore.kernel.org/r/20251011082738.173670-3-costa.shul@redhat.c= om Signed-off-by: Tomas Glozar --- tools/tracing/rtla/src/timerlat_top.c | 28 +++++++++++---------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src= /timerlat_top.c index 9664b8af727e..67a5b6ab78a6 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -474,7 +474,7 @@ timerlat_print_stats(struct osnoise_tool *top) /* * timerlat_top_usage - prints timerlat top usage message */ -static void timerlat_top_usage(char *usage) +static void timerlat_top_usage(void) { int i; =20 @@ -522,18 +522,12 @@ static void timerlat_top_usage(char *usage) NULL, }; =20 - if (usage) - fprintf(stderr, "%s\n", usage); - fprintf(stderr, "rtla timerlat top: a per-cpu summary of the timer latenc= y (version %s)\n", VERSION); =20 for (i =3D 0; msg[i]; i++) fprintf(stderr, "%s\n", msg[i]); =20 - if (usage) - exit(EXIT_FAILURE); - exit(EXIT_SUCCESS); } =20 @@ -643,7 +637,7 @@ static struct common_params case 'c': retval =3D parse_cpu_set(optarg, ¶ms->common.monitored_cpus); if (retval) - timerlat_top_usage("\nInvalid -c cpu list\n"); + fatal("Invalid -c cpu list"); params->common.cpus =3D optarg; break; case 'C': @@ -662,7 +656,7 @@ static struct common_params case 'd': params->common.duration =3D parse_seconds_duration(optarg); if (!params->common.duration) - timerlat_top_usage("Invalid -d duration\n"); + fatal("Invalid -d duration"); break; case 'e': tevent =3D trace_event_alloc(optarg); @@ -675,7 +669,7 @@ static struct common_params break; case 'h': case '?': - timerlat_top_usage(NULL); + timerlat_top_usage(); break; case 'H': params->common.hk_cpus =3D 1; @@ -695,12 +689,12 @@ static struct common_params case 'p': params->timerlat_period_us =3D get_llong_from_str(optarg); if (params->timerlat_period_us > 1000000) - timerlat_top_usage("Period longer than 1 s\n"); + fatal("Period longer than 1 s"); break; case 'P': retval =3D parse_prio(optarg, ¶ms->common.sched_param); if (retval =3D=3D -1) - timerlat_top_usage("Invalid -P priority"); + fatal("Invalid -P priority"); params->common.set_sched =3D 1; break; case 'q': @@ -735,7 +729,7 @@ static struct common_params if (retval) fatal("Error adding trigger %s", optarg); } else { - timerlat_top_usage("--trigger requires a previous -e\n"); + fatal("--trigger requires a previous -e"); } break; case '1': /* filter */ @@ -744,7 +738,7 @@ static struct common_params if (retval) fatal("Error adding filter %s", optarg); } else { - timerlat_top_usage("--filter requires a previous -e\n"); + fatal("--filter requires a previous -e"); } break; case '2': /* dma-latency */ @@ -780,7 +774,7 @@ static struct common_params fatal("Invalid action %s", optarg); break; default: - timerlat_top_usage("Invalid option"); + fatal("Invalid option"); } } =20 @@ -797,10 +791,10 @@ static struct common_params params->no_aa =3D 1; =20 if (params->no_aa && params->common.aa_only) - timerlat_top_usage("--no-aa and --aa-only are mutually exclusive!"); + fatal("--no-aa and --aa-only are mutually exclusive!"); =20 if (params->common.kernel_workload && params->common.user_workload) - timerlat_top_usage("--kernel-threads and --user-threads are mutually exc= lusive!"); + fatal("--kernel-threads and --user-threads are mutually exclusive!"); =20 /* * If auto-analysis or trace output is enabled, switch from BPF mode to --=20 2.51.0