From nobody Tue Dec 2 02:05:04 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 6A42730E846 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=QzTVt+EO7byizbZZvbHwJIXAL4Q03y1HWkF0c4gjItReiwWkX50vrhE4ZUImP00pqIpnSqS0rwbc61y6l+fCalrNBPz4PHQgQRWbWvCcGgITYi7HaJXPy81Bc1OZBhygVNGi8tJMKqoppN9dYLCvrK0VUtdM0gpiQXqJwN8v2j0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763681196; c=relaxed/simple; bh=TZaQcTgJ45YFPh0gvdA/JfCWO6ou6uQ4Veh22IfFX6I=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=EbosGsYJ7JGOjBKKRKkC2qAePyLDHxsTag3qWHsGlGhXOFLlSMIqt9ball9AInuk8IrBabayjE0pxPM2o+DwREBYC8LT2ubQG8DDV++j0bnuaiIeMsrCrdp69diIf1GK/jUfuS5hcb/Oe1VYdNHaTfVS59EbfO1r92SrCGRL2+Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZDlgvTUK; 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="ZDlgvTUK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B4ACC19424; Thu, 20 Nov 2025 23:26:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763681196; bh=TZaQcTgJ45YFPh0gvdA/JfCWO6ou6uQ4Veh22IfFX6I=; h=Date:From:To:Cc:Subject:References:From; b=ZDlgvTUKx70j6fDzsb/ehC0giHViEY+w8aWTMmMzH/eZuCYeXABqvEFkuvqHZoEB8 bnBQVD70cqvhgn7rDCDKWQv7Fmsa0enmEcxDuwSNp4fwnwPvZumU+0M825+MnTNeND q+BmJwsfbiGQCnPFoyd+tRY7uOaNeTBsv0qAxizRVmDESj47AZ1HgIiHYLd0gRQwcC 3jxFZ7mw01Me7JYy7oRoc/F3XvHMxYwiF1DOuH+nNfKCaj0HXlvUwD3m6KsrOi5UtG zQcbd0800C3CGdBEFUFdxyLm5RK5gxrhvAIrbOVwgmF9Xl8SMTOQ9/Ebc7LaFfXuQO In9WaQlpm5dCg== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1vME3R-000000041wC-1qdY; Thu, 20 Nov 2025 18:27:09 -0500 Message-ID: <20251120232709.284177809@kernel.org> User-Agent: quilt/0.68 Date: Thu, 20 Nov 2025 18:23:35 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Costa Shulyupin Subject: [for-next][PATCH 12/16] tools/rtla: Replace osnoise_hist_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 osnoise_hist_usage("...") with fatal("...") on errors. Remove the already unused 'usage' argument from osnoise_hist_usage(). Signed-off-by: Costa Shulyupin Reviewed-by: Tomas Glozar Link: https://lore.kernel.org/r/20251011082738.173670-6-costa.shul@redhat.c= om Signed-off-by: Tomas Glozar --- tools/tracing/rtla/src/osnoise_hist.c | 32 +++++++++++---------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src= /osnoise_hist.c index d30a9a03b764..1d841a3056bc 100644 --- a/tools/tracing/rtla/src/osnoise_hist.c +++ b/tools/tracing/rtla/src/osnoise_hist.c @@ -407,7 +407,7 @@ osnoise_print_stats(struct osnoise_tool *tool) /* * osnoise_hist_usage - prints osnoise hist usage message */ -static void osnoise_hist_usage(char *usage) +static void osnoise_hist_usage(void) { int i; =20 @@ -453,18 +453,12 @@ static void osnoise_hist_usage(char *usage) NULL, }; =20 - if (usage) - fprintf(stderr, "%s\n", usage); - fprintf(stderr, "rtla osnoise hist: a per-cpu histogram of the OS noise (= 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 @@ -547,12 +541,12 @@ static struct common_params params->common.hist.bucket_size =3D get_llong_from_str(optarg); if (params->common.hist.bucket_size =3D=3D 0 || params->common.hist.bucket_size >=3D 1000000) - osnoise_hist_usage("Bucket size needs to be > 0 and <=3D 1000000\n"); + fatal("Bucket size needs to be > 0 and <=3D 1000000"); break; case 'c': retval =3D parse_cpu_set(optarg, ¶ms->common.monitored_cpus); if (retval) - osnoise_hist_usage("\nInvalid -c cpu list\n"); + fatal("Invalid -c cpu list"); params->common.cpus =3D optarg; break; case 'C': @@ -571,7 +565,7 @@ static struct common_params case 'd': params->common.duration =3D parse_seconds_duration(optarg); if (!params->common.duration) - osnoise_hist_usage("Invalid -D duration\n"); + fatal("Invalid -D duration"); break; case 'e': tevent =3D trace_event_alloc(optarg); @@ -587,11 +581,11 @@ static struct common_params params->common.hist.entries =3D get_llong_from_str(optarg); if (params->common.hist.entries < 10 || params->common.hist.entries > 9999999) - osnoise_hist_usage("Entries must be > 10 and < 9999999\n"); + fatal("Entries must be > 10 and < 9999999"); break; case 'h': case '?': - osnoise_hist_usage(NULL); + osnoise_hist_usage(); break; case 'H': params->common.hk_cpus =3D 1; @@ -602,18 +596,18 @@ static struct common_params case 'p': params->period =3D get_llong_from_str(optarg); if (params->period > 10000000) - osnoise_hist_usage("Period longer than 10 s\n"); + fatal("Period longer than 10 s"); break; case 'P': retval =3D parse_prio(optarg, ¶ms->common.sched_param); if (retval =3D=3D -1) - osnoise_hist_usage("Invalid -P priority"); + fatal("Invalid -P priority"); params->common.set_sched =3D 1; break; case 'r': params->runtime =3D get_llong_from_str(optarg); if (params->runtime < 100) - osnoise_hist_usage("Runtime shorter than 100 us\n"); + fatal("Runtime shorter than 100 us"); break; case 's': params->common.stop_us =3D get_llong_from_str(optarg); @@ -653,7 +647,7 @@ static struct common_params if (retval) fatal("Error adding trigger %s", optarg); } else { - osnoise_hist_usage("--trigger requires a previous -e\n"); + fatal("--trigger requires a previous -e"); } break; case '5': /* filter */ @@ -662,7 +656,7 @@ static struct common_params if (retval) fatal("Error adding filter %s", optarg); } else { - osnoise_hist_usage("--filter requires a previous -e\n"); + fatal("--filter requires a previous -e"); } break; case '6': @@ -684,7 +678,7 @@ static struct common_params fatal("Invalid action %s", optarg); break; default: - osnoise_hist_usage("Invalid option"); + fatal("Invalid option"); } } =20 @@ -695,7 +689,7 @@ static struct common_params fatal("rtla needs root permission"); =20 if (params->common.hist.no_index && !params->common.hist.with_zeros) - osnoise_hist_usage("no-index set and with-zeros not set - it does not ma= ke sense"); + fatal("no-index set and with-zeros not set - it does not make sense"); =20 return ¶ms->common; } --=20 2.51.0