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 5529930E0FA 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=tbWIG+1Z/c9YDGWESEMHHEmUeQ+KV5EiHQ589QWBN9u+2tMCEbqH1DT2h6RWc+pKAPO9rNMSRpXoVPwDtuHF3jIeQUMgwRlUfugEknVETgBANYjZcVLy79Zi2ZxZeg2YatoTOnX+VjEfxmkHMI4vPfJ+BaRIcPJwWbXFS9nc3Z8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763681196; c=relaxed/simple; bh=qZA3sqcF49+mmt4svzGC8rVGlQvokHq4EJY1K09BjSU=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=k0ytdePCpfD7T5GnHbbrKzaF8f/ZhTTC9+viUEsw9VZfh70viMBg9u8Phd4NRKO3H+uDpBo10bAvemVSEALPuffvVm2Nctl8Agn8iLjJUpLlK0qDII8Az5KRHEy+jG3eN8bfXubF5EAClNgV19G7rw68D6V6kYNeCmBU34MVAlY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Fu8GpOTm; 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="Fu8GpOTm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9A4CC116B1; 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=qZA3sqcF49+mmt4svzGC8rVGlQvokHq4EJY1K09BjSU=; h=Date:From:To:Cc:Subject:References:From; b=Fu8GpOTmvzUOTa0HYdVfouQV8vOS2emct7fFQtK44BA2bAUynF1l59wtQGwq4Git6 UgLdYHAzAPaegNsdeNCqePV/A4iek5o1pi9DeUCURiaDa5v7PW6aJvfFwS8jol8x0k tpjmmKv1wRV72dtWIyDVimImfJhp53u9Sy+skDvS5NgmDyy5fljC7Gc7ey4VXFZhK2 osXYFLTgsIMdLlcQB/mEHdIshGKtaXUeGvDQWxrnViZL2grjN6Ec+V3QUalPgf3s3J /8yI4eDXiygDS/G8otfWKSX1VcczOd9aiCGGerCb/eoo8rCglbhmUOG/RoOExPpg+g EqSQEGdm2nWaA== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1vME3R-000000041vA-0OgC; Thu, 20 Nov 2025 18:27:09 -0500 Message-ID: <20251120232708.950141984@kernel.org> User-Agent: quilt/0.68 Date: Thu, 20 Nov 2025 18:23:33 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Costa Shulyupin Subject: [for-next][PATCH 10/16] tools/rtla: Replace timerlat_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 timerlat_hist_usage("...\n") with fatal("...") on errors. Remove the already unused 'usage' argument from timerlat_hist_usage(). Signed-off-by: Costa Shulyupin Reviewed-by: Tomas Glozar Link: https://lore.kernel.org/r/20251011082738.173670-4-costa.shul@redhat.c= om Signed-off-by: Tomas Glozar --- tools/tracing/rtla/src/timerlat_hist.c | 32 +++++++++++--------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/sr= c/timerlat_hist.c index f98deb16b452..1b505531ad3b 100644 --- a/tools/tracing/rtla/src/timerlat_hist.c +++ b/tools/tracing/rtla/src/timerlat_hist.c @@ -694,7 +694,7 @@ timerlat_print_stats(struct osnoise_tool *tool) /* * timerlat_hist_usage - prints timerlat top usage message */ -static void timerlat_hist_usage(char *usage) +static void timerlat_hist_usage(void) { int i; =20 @@ -750,18 +750,12 @@ static void timerlat_hist_usage(char *usage) NULL, }; =20 - if (usage) - fprintf(stderr, "%s\n", usage); - fprintf(stderr, "rtla timerlat hist: a per-cpu histogram of the timer lat= ency (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 @@ -865,7 +859,7 @@ static struct common_params case 'c': retval =3D parse_cpu_set(optarg, ¶ms->common.monitored_cpus); if (retval) - timerlat_hist_usage("\nInvalid -c cpu list\n"); + fatal("Invalid -c cpu list"); params->common.cpus =3D optarg; break; case 'C': @@ -882,7 +876,7 @@ 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) - timerlat_hist_usage("Bucket size needs to be > 0 and <=3D 1000000\n"); + fatal("Bucket size needs to be > 0 and <=3D 1000000"); break; case 'D': config_debug =3D 1; @@ -890,7 +884,7 @@ static struct common_params case 'd': params->common.duration =3D parse_seconds_duration(optarg); if (!params->common.duration) - timerlat_hist_usage("Invalid -D duration\n"); + fatal("Invalid -D duration"); break; case 'e': tevent =3D trace_event_alloc(optarg); @@ -906,11 +900,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) - timerlat_hist_usage("Entries must be > 10 and < 9999999\n"); + fatal("Entries must be > 10 and < 9999999"); break; case 'h': case '?': - timerlat_hist_usage(NULL); + timerlat_hist_usage(); break; case 'H': params->common.hk_cpus =3D 1; @@ -930,12 +924,12 @@ static struct common_params case 'p': params->timerlat_period_us =3D get_llong_from_str(optarg); if (params->timerlat_period_us > 1000000) - timerlat_hist_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_hist_usage("Invalid -P priority"); + fatal("Invalid -P priority"); params->common.set_sched =3D 1; break; case 's': @@ -985,7 +979,7 @@ static struct common_params if (retval) fatal("Error adding trigger %s", optarg); } else { - timerlat_hist_usage("--trigger requires a previous -e\n"); + fatal("--trigger requires a previous -e"); } break; case '7': /* filter */ @@ -994,7 +988,7 @@ static struct common_params if (retval) fatal("Error adding filter %s", optarg); } else { - timerlat_hist_usage("--filter requires a previous -e\n"); + fatal("--filter requires a previous -e"); } break; case '8': @@ -1041,10 +1035,10 @@ static struct common_params fatal("rtla needs root permission"); =20 if (params->common.hist.no_irq && params->common.hist.no_thread) - timerlat_hist_usage("no-irq and no-thread set, there is nothing to do he= re"); + fatal("no-irq and no-thread set, there is nothing to do here"); =20 if (params->common.hist.no_index && !params->common.hist.with_zeros) - timerlat_hist_usage("no-index set with with-zeros is not set - it does n= ot make sense"); + fatal("no-index set with with-zeros is not set - it does not make sense"= ); =20 /* * Auto analysis only happens if stop tracing, thus: @@ -1053,7 +1047,7 @@ static struct common_params params->no_aa =3D 1; =20 if (params->common.kernel_workload && params->common.user_workload) - timerlat_hist_usage("--kernel-threads and --user-threads are mutually ex= clusive!"); + 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