Skip to content

Commit b5f3193

Browse files
John KacurDaniel Bristot de Oliveira
authored andcommitted
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: 1eeb632 ("rtla/timerlat: Add timerlat hist mode") Signed-off-by: John Kacur <jkacur@redhat.com> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
1 parent 14f08c9 commit b5f3193

4 files changed

Lines changed: 20 additions & 4 deletions

File tree

tools/tracing/rtla/src/osnoise_hist.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,11 @@ static void osnoise_hist_usage(char *usage)
479479

480480
for (i = 0; msg[i]; i++)
481481
fprintf(stderr, "%s\n", msg[i]);
482-
exit(1);
482+
483+
if (usage)
484+
exit(EXIT_FAILURE);
485+
486+
exit(EXIT_SUCCESS);
483487
}
484488

485489
/*

tools/tracing/rtla/src/osnoise_top.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,11 @@ static void osnoise_top_usage(struct osnoise_top_params *params, char *usage)
331331

332332
for (i = 0; msg[i]; i++)
333333
fprintf(stderr, "%s\n", msg[i]);
334-
exit(1);
334+
335+
if (usage)
336+
exit(EXIT_FAILURE);
337+
338+
exit(EXIT_SUCCESS);
335339
}
336340

337341
/*

tools/tracing/rtla/src/timerlat_hist.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,11 @@ static void timerlat_hist_usage(char *usage)
545545

546546
for (i = 0; msg[i]; i++)
547547
fprintf(stderr, "%s\n", msg[i]);
548-
exit(1);
548+
549+
if (usage)
550+
exit(EXIT_FAILURE);
551+
552+
exit(EXIT_SUCCESS);
549553
}
550554

551555
/*

tools/tracing/rtla/src/timerlat_top.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,11 @@ static void timerlat_top_usage(char *usage)
375375

376376
for (i = 0; msg[i]; i++)
377377
fprintf(stderr, "%s\n", msg[i]);
378-
exit(1);
378+
379+
if (usage)
380+
exit(EXIT_FAILURE);
381+
382+
exit(EXIT_SUCCESS);
379383
}
380384

381385
/*

0 commit comments

Comments
 (0)