tools/rtla: Replace timerlat_hist_usage("...") with fatal("...")
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 <costa.shul@redhat.com>
Reviewed-by: Tomas Glozar <tglozar@redhat.com>
Link: https://lore.kernel.org/r/20251011082738.173670-4-costa.shul@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
pull/1354/merge
parent
4e5e7210f9
commit
8f4264e046
|
|
@ -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;
|
||||
|
||||
|
|
@ -750,18 +750,12 @@ static void timerlat_hist_usage(char *usage)
|
|||
NULL,
|
||||
};
|
||||
|
||||
if (usage)
|
||||
fprintf(stderr, "%s\n", usage);
|
||||
|
||||
fprintf(stderr, "rtla timerlat hist: a per-cpu histogram of the timer latency (version %s)\n",
|
||||
VERSION);
|
||||
|
||||
for (i = 0; msg[i]; i++)
|
||||
fprintf(stderr, "%s\n", msg[i]);
|
||||
|
||||
if (usage)
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
@ -865,7 +859,7 @@ static struct common_params
|
|||
case 'c':
|
||||
retval = 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 = optarg;
|
||||
break;
|
||||
case 'C':
|
||||
|
|
@ -882,7 +876,7 @@ static struct common_params
|
|||
params->common.hist.bucket_size = get_llong_from_str(optarg);
|
||||
if (params->common.hist.bucket_size == 0 ||
|
||||
params->common.hist.bucket_size >= 1000000)
|
||||
timerlat_hist_usage("Bucket size needs to be > 0 and <= 1000000\n");
|
||||
fatal("Bucket size needs to be > 0 and <= 1000000");
|
||||
break;
|
||||
case 'D':
|
||||
config_debug = 1;
|
||||
|
|
@ -890,7 +884,7 @@ static struct common_params
|
|||
case 'd':
|
||||
params->common.duration = parse_seconds_duration(optarg);
|
||||
if (!params->common.duration)
|
||||
timerlat_hist_usage("Invalid -D duration\n");
|
||||
fatal("Invalid -D duration");
|
||||
break;
|
||||
case 'e':
|
||||
tevent = trace_event_alloc(optarg);
|
||||
|
|
@ -906,11 +900,11 @@ static struct common_params
|
|||
params->common.hist.entries = 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 = 1;
|
||||
|
|
@ -930,12 +924,12 @@ static struct common_params
|
|||
case 'p':
|
||||
params->timerlat_period_us = 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 = parse_prio(optarg, ¶ms->common.sched_param);
|
||||
if (retval == -1)
|
||||
timerlat_hist_usage("Invalid -P priority");
|
||||
fatal("Invalid -P priority");
|
||||
params->common.set_sched = 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");
|
||||
|
||||
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 here");
|
||||
fatal("no-irq and no-thread set, there is nothing to do here");
|
||||
|
||||
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 not make sense");
|
||||
fatal("no-index set with with-zeros is not set - it does not make sense");
|
||||
|
||||
/*
|
||||
* Auto analysis only happens if stop tracing, thus:
|
||||
|
|
@ -1053,7 +1047,7 @@ static struct common_params
|
|||
params->no_aa = 1;
|
||||
|
||||
if (params->common.kernel_workload && params->common.user_workload)
|
||||
timerlat_hist_usage("--kernel-threads and --user-threads are mutually exclusive!");
|
||||
fatal("--kernel-threads and --user-threads are mutually exclusive!");
|
||||
|
||||
/*
|
||||
* If auto-analysis or trace output is enabled, switch from BPF mode to
|
||||
|
|
|
|||
Loading…
Reference in New Issue