Skip to contentSkip to conversation

rtla: osnoise: timerlat: exit with EXIT_SUCCESS when help is invoked

PATCH In review John Kacur 2 participants 2 messages Feb 3, 2024 – Feb 8, 2024 Real-time Linux Analysis (rtla) tools

lore
Share & tools
lore

John Kacur

author
#0 lore raw

PATCH 1/1 rtla: osnoise: timerlat: 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

---
 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(-)
tools/tracing/rtla/src/osnoise_hist.c +5 -1
index 8f81fa007364..839257e5925d 100644
@@ -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);
 }
 
 /*
tools/tracing/rtla/src/osnoise_top.c +5 -1
index f7c959be8677..457360db0767 100644
@@ -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);
 }
 
 /*
tools/tracing/rtla/src/timerlat_hist.c +5 -1
index 47d3d8b53cb2..81c6160d1757 100644
@@ -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);
 }
 
 /*
tools/tracing/rtla/src/timerlat_top.c +5 -1
index 1640f121baca..3e9af2c38688 100644
@@ -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);
 }
 
 /*
Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · John Kacur

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