From nobody Tue Dec 2 02:20:23 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 4F5F230E0F2 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=DAFnEQR1ab1RHXc4xTJ6yScI8k6Z6m5xr+2RDrw4uY5+qvhiUmVg9+OOgy5FGG254ghFL5dVBEsbGy3AG64E77BcjffcQALHh0lvBs9ZnprTwzVhhzTuyWu+3uZpsrXb+hKps0EvtqhG6o//71QMuPFwCTkNoAPUafszE0d/Eu0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763681196; c=relaxed/simple; bh=XfvBng7ontzsxvqGcwXtl01KHWualoUe1o62QFRNRCk=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=ZH1eng7eH8pASGHYv25SlZbaZcq76KtCxJxtWSxDshSZjRQfAp3G32vj6pi7zGagzBtsaIJjXtfhS/ZHTZ/8MTcAU1IAgV4/holvOlZ+fh+NELPWFFWMQzxr6fqyd/tX0vHUGMwB60MnYKUcXOJts0wuEijjWHZD0jmJ7VbMhxM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cOfQDHSC; 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="cOfQDHSC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F4C4C116C6; 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=XfvBng7ontzsxvqGcwXtl01KHWualoUe1o62QFRNRCk=; h=Date:From:To:Cc:Subject:References:From; b=cOfQDHSCGPCjjj26plCo0W1I3hfTgROQhW+4IE772seJUyPiub9KucNCpe2Yu2JHM e5g+Poo7vZMYoSpfeKgsuvkQxI38R/ZyfD2yog+VOU1RaT9jkqgzwpmIb7tO5PCn8I nge010/XxhWod+WHGs7Y6YB1kp0UlJv6R0/kui9E/3aQHCQ9Wj65dSybcSCznbYGpz Xm698TftGaR1atClPhFhDIjaGq9wZ1PjkBoJio2d45xXxIQUM3Bq0kAT+65ceCWoMh eV9eEuWqd7deQRC4ypl/C26HhrUgigBqR5rik6hTzBFfaFP6Vvrfg51fp7ed/SWktl 6Lml/yxKcb8og== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1vME3R-000000041vf-17LJ; Thu, 20 Nov 2025 18:27:09 -0500 Message-ID: <20251120232709.115021875@kernel.org> User-Agent: quilt/0.68 Date: Thu, 20 Nov 2025 18:23:34 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Costa Shulyupin Subject: [for-next][PATCH 11/16] tools/rtla: Replace osnoise_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 osnoise_top_usage("...") with fatal("...") on errors. Remove the already unused 'usage' argument from osnoise_top_usage(). Signed-off-by: Costa Shulyupin Reviewed-by: Tomas Glozar Link: https://lore.kernel.org/r/20251011082738.173670-5-costa.shul@redhat.c= om Signed-off-by: Tomas Glozar --- tools/tracing/rtla/src/osnoise_top.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/= osnoise_top.c index 487daac8908c..de8e26d7c68b 100644 --- a/tools/tracing/rtla/src/osnoise_top.c +++ b/tools/tracing/rtla/src/osnoise_top.c @@ -255,7 +255,7 @@ osnoise_print_stats(struct osnoise_tool *top) /* * osnoise_top_usage - prints osnoise top usage message */ -static void osnoise_top_usage(struct osnoise_params *params, char *usage) +static void osnoise_top_usage(struct osnoise_params *params) { int i; =20 @@ -294,9 +294,6 @@ static void osnoise_top_usage(struct osnoise_params *pa= rams, char *usage) NULL, }; =20 - if (usage) - fprintf(stderr, "%s\n", usage); - if (params->mode =3D=3D MODE_OSNOISE) { fprintf(stderr, "rtla osnoise top: a per-cpu summary of the OS noise (version %s)\n", @@ -316,9 +313,6 @@ static void osnoise_top_usage(struct osnoise_params *pa= rams, char *usage) for (i =3D 0; msg[i]; i++) fprintf(stderr, "%s\n", msg[i]); =20 - if (usage) - exit(EXIT_FAILURE); - exit(EXIT_SUCCESS); } =20 @@ -398,7 +392,7 @@ struct common_params *osnoise_top_parse_args(int argc, = char **argv) case 'c': retval =3D parse_cpu_set(optarg, ¶ms->common.monitored_cpus); if (retval) - osnoise_top_usage(params, "\nInvalid -c cpu list\n"); + fatal("Invalid -c cpu list"); params->common.cpus =3D optarg; break; case 'C': @@ -417,7 +411,7 @@ struct common_params *osnoise_top_parse_args(int argc, = char **argv) case 'd': params->common.duration =3D parse_seconds_duration(optarg); if (!params->common.duration) - osnoise_top_usage(params, "Invalid -d duration\n"); + fatal("Invalid -d duration"); break; case 'e': tevent =3D trace_event_alloc(optarg); @@ -431,7 +425,7 @@ struct common_params *osnoise_top_parse_args(int argc, = char **argv) break; case 'h': case '?': - osnoise_top_usage(params, NULL); + osnoise_top_usage(params); break; case 'H': params->common.hk_cpus =3D 1; @@ -442,12 +436,12 @@ struct common_params *osnoise_top_parse_args(int argc= , char **argv) case 'p': params->period =3D get_llong_from_str(optarg); if (params->period > 10000000) - osnoise_top_usage(params, "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_top_usage(params, "Invalid -P priority"); + fatal("Invalid -P priority"); params->common.set_sched =3D 1; break; case 'q': @@ -456,7 +450,7 @@ struct common_params *osnoise_top_parse_args(int argc, = char **argv) case 'r': params->runtime =3D get_llong_from_str(optarg); if (params->runtime < 100) - osnoise_top_usage(params, "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); @@ -484,7 +478,7 @@ struct common_params *osnoise_top_parse_args(int argc, = char **argv) if (retval) fatal("Error adding trigger %s", optarg); } else { - osnoise_top_usage(params, "--trigger requires a previous -e\n"); + fatal("--trigger requires a previous -e"); } break; case '1': /* filter */ @@ -493,7 +487,7 @@ struct common_params *osnoise_top_parse_args(int argc, = char **argv) if (retval) fatal("Error adding filter %s", optarg); } else { - osnoise_top_usage(params, "--filter requires a previous -e\n"); + fatal("--filter requires a previous -e"); } break; case '2': @@ -515,7 +509,7 @@ struct common_params *osnoise_top_parse_args(int argc, = char **argv) fatal("Invalid action %s", optarg); break; default: - osnoise_top_usage(params, "Invalid option"); + fatal("Invalid option"); } } =20 --=20 2.51.0