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

tools/rtla: Exit with EXIT_SUCCESS when help is invoked

Fix rtla so that the following commands exit with 0 when help is invoked

rtla osnoise top -h
rtla osnoise hist -h
rtla timerlat top -h
rtla timerlat hist -h

Link: https://lore.kernel.org/linux-trace-devel/20240203001607.69703-1-jkacur@redhat.com

Cc: stable@vger.kernel.org
Fixes: 1eeb6328e8b3 ("rtla/timerlat: Add timerlat hist mode")
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>

authored by

John Kacur and committed by
Daniel Bristot de Oliveira
b5f31936 14f08c97

+20 -4
+5 -1
tools/tracing/rtla/src/osnoise_hist.c
··· 479 479 480 480 for (i = 0; msg[i]; i++) 481 481 fprintf(stderr, "%s\n", msg[i]); 482 - exit(1); 482 + 483 + if (usage) 484 + exit(EXIT_FAILURE); 485 + 486 + exit(EXIT_SUCCESS); 483 487 } 484 488 485 489 /*
+5 -1
tools/tracing/rtla/src/osnoise_top.c
··· 331 331 332 332 for (i = 0; msg[i]; i++) 333 333 fprintf(stderr, "%s\n", msg[i]); 334 - exit(1); 334 + 335 + if (usage) 336 + exit(EXIT_FAILURE); 337 + 338 + exit(EXIT_SUCCESS); 335 339 } 336 340 337 341 /*
+5 -1
tools/tracing/rtla/src/timerlat_hist.c
··· 545 545 546 546 for (i = 0; msg[i]; i++) 547 547 fprintf(stderr, "%s\n", msg[i]); 548 - exit(1); 548 + 549 + if (usage) 550 + exit(EXIT_FAILURE); 551 + 552 + exit(EXIT_SUCCESS); 549 553 } 550 554 551 555 /*
+5 -1
tools/tracing/rtla/src/timerlat_top.c
··· 375 375 376 376 for (i = 0; msg[i]; i++) 377 377 fprintf(stderr, "%s\n", msg[i]); 378 - exit(1); 378 + 379 + if (usage) 380 + exit(EXIT_FAILURE); 381 + 382 + exit(EXIT_SUCCESS); 379 383 } 380 384 381 385 /*