rtla: osnoise: timerlat: exit with EXIT_SUCCESS when help is invoked
Commit Message
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
Signed-off-by: John Kacur <jkacur@redhat.com>
---
tools/tracing/rtla/src/osnoise_hist.c | 6 +++++-
tools/tracing/rtla/src/osnoise_top.c | 6 +++++-
tools/tracing/rtla/src/timerlat_hist.c | 6 +++++-
tools/tracing/rtla/src/timerlat_top.c | 6 +++++-
4 files changed, 20 insertions(+), 4 deletions(-)
Comments
On 2/3/24 01:16, John Kacur wrote:
> 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
right, I am setting this as a fix.
Thanks John.
-- Daniel
@@ -480,7 +480,11 @@ static void osnoise_hist_usage(char *usage)
for (i = 0; msg[i]; i++)
fprintf(stderr, "%s\n", msg[i]);
- exit(1);
+
+ if (usage)
+ exit(EXIT_FAILURE);
+
+ exit(EXIT_SUCCESS);
}
/*
@@ -331,7 +331,11 @@ static void osnoise_top_usage(struct osnoise_top_params *params, char *usage)
for (i = 0; msg[i]; i++)
fprintf(stderr, "%s\n", msg[i]);
- exit(1);
+
+ if (usage)
+ exit(EXIT_FAILURE);
+
+ exit(EXIT_SUCCESS);
}
/*
@@ -546,7 +546,11 @@ static void timerlat_hist_usage(char *usage)
for (i = 0; msg[i]; i++)
fprintf(stderr, "%s\n", msg[i]);
- exit(1);
+
+ if (usage)
+ exit(EXIT_FAILURE);
+
+ exit(EXIT_SUCCESS);
}
/*
@@ -375,7 +375,11 @@ static void timerlat_top_usage(char *usage)
for (i = 0; msg[i]; i++)
fprintf(stderr, "%s\n", msg[i]);
- exit(1);
+
+ if (usage)
+ exit(EXIT_FAILURE);
+
+ exit(EXIT_SUCCESS);
}
/*