Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tools/rtla: Replace osnoise_top_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 osnoise_top_usage("...") with fatal("...") on errors.

Remove the already unused 'usage' argument from osnoise_top_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-5-costa.shul@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>

authored by

Costa Shulyupin and committed by
Tomas Glozar
92b5b55e 8f4264e0

+10 -16
+10 -16
tools/tracing/rtla/src/osnoise_top.c
··· 255 255 /* 256 256 * osnoise_top_usage - prints osnoise top usage message 257 257 */ 258 - static void osnoise_top_usage(struct osnoise_params *params, char *usage) 258 + static void osnoise_top_usage(struct osnoise_params *params) 259 259 { 260 260 int i; 261 261 ··· 294 294 NULL, 295 295 }; 296 296 297 - if (usage) 298 - fprintf(stderr, "%s\n", usage); 299 - 300 297 if (params->mode == MODE_OSNOISE) { 301 298 fprintf(stderr, 302 299 "rtla osnoise top: a per-cpu summary of the OS noise (version %s)\n", ··· 312 315 313 316 for (i = 0; msg[i]; i++) 314 317 fprintf(stderr, "%s\n", msg[i]); 315 - 316 - if (usage) 317 - exit(EXIT_FAILURE); 318 318 319 319 exit(EXIT_SUCCESS); 320 320 } ··· 392 398 case 'c': 393 399 retval = parse_cpu_set(optarg, &params->common.monitored_cpus); 394 400 if (retval) 395 - osnoise_top_usage(params, "\nInvalid -c cpu list\n"); 401 + fatal("Invalid -c cpu list"); 396 402 params->common.cpus = optarg; 397 403 break; 398 404 case 'C': ··· 411 417 case 'd': 412 418 params->common.duration = parse_seconds_duration(optarg); 413 419 if (!params->common.duration) 414 - osnoise_top_usage(params, "Invalid -d duration\n"); 420 + fatal("Invalid -d duration"); 415 421 break; 416 422 case 'e': 417 423 tevent = trace_event_alloc(optarg); ··· 425 431 break; 426 432 case 'h': 427 433 case '?': 428 - osnoise_top_usage(params, NULL); 434 + osnoise_top_usage(params); 429 435 break; 430 436 case 'H': 431 437 params->common.hk_cpus = 1; ··· 436 442 case 'p': 437 443 params->period = get_llong_from_str(optarg); 438 444 if (params->period > 10000000) 439 - osnoise_top_usage(params, "Period longer than 10 s\n"); 445 + fatal("Period longer than 10 s"); 440 446 break; 441 447 case 'P': 442 448 retval = parse_prio(optarg, &params->common.sched_param); 443 449 if (retval == -1) 444 - osnoise_top_usage(params, "Invalid -P priority"); 450 + fatal("Invalid -P priority"); 445 451 params->common.set_sched = 1; 446 452 break; 447 453 case 'q': ··· 450 456 case 'r': 451 457 params->runtime = get_llong_from_str(optarg); 452 458 if (params->runtime < 100) 453 - osnoise_top_usage(params, "Runtime shorter than 100 us\n"); 459 + fatal("Runtime shorter than 100 us"); 454 460 break; 455 461 case 's': 456 462 params->common.stop_us = get_llong_from_str(optarg); ··· 478 484 if (retval) 479 485 fatal("Error adding trigger %s", optarg); 480 486 } else { 481 - osnoise_top_usage(params, "--trigger requires a previous -e\n"); 487 + fatal("--trigger requires a previous -e"); 482 488 } 483 489 break; 484 490 case '1': /* filter */ ··· 487 493 if (retval) 488 494 fatal("Error adding filter %s", optarg); 489 495 } else { 490 - osnoise_top_usage(params, "--filter requires a previous -e\n"); 496 + fatal("--filter requires a previous -e"); 491 497 } 492 498 break; 493 499 case '2': ··· 509 515 fatal("Invalid action %s", optarg); 510 516 break; 511 517 default: 512 - osnoise_top_usage(params, "Invalid option"); 518 + fatal("Invalid option"); 513 519 } 514 520 } 515 521