Skip to contentSkip to conversation

perf test: print if shell directory isn't present

PATCH Applied Ian Rogers 4 participants 4 messages Mar 13, 2020 – Mar 19, 2020 perf events

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 perf test: print if shell directory isn't present

If the shell test directory isn't present the exit code will be 255 but with no error messages printed. Add an error message.

---
 tools/perf/tests/builtin-test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/perf/tests/builtin-test.c +4 -1
index 5f05db75cdd8..54d9516c9839 100644
@@ -543,8 +543,11 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width)
 		return -1;
 
 	dir = opendir(st.dir);
-	if (!dir)
+	if (!dir) {
+		pr_err("failed to open shell test directory: %s\n",
+			st.dir);
 		return -1;
+	}
 
 	for_each_shell_test(dir, st.dir, ent) {
 		int curr = i++;
Signature · 1 line
2.25.1.481.gfbce0eb801-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Ian Rogers

If the shell test directory isn't present the exit code will be 255 but with no error messages printed. Add an error message.

thanks,
jirka

Quoted 24 lines
---
 tools/perf/tests/builtin-test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/perf/tests/builtin-test.c +4 -1
index 5f05db75cdd8..54d9516c9839 100644
@@ -543,8 +543,11 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width)
 		return -1;
 
 	dir = opendir(st.dir);
-	if (!dir)
+	if (!dir) {
+		pr_err("failed to open shell test directory: %s\n",
+			st.dir);
 		return -1;
+	}
 
 	for_each_shell_test(dir, st.dir, ent) {
 		int curr = i++;
Signature · 1 line
2.25.1.481.gfbce0eb801-goog
#2 lore raw

Em Fri, Mar 13, 2020 at 10:37:34AM +0100, Jiri Olsa escreveu:

Quoted 7 lines · Ian Rogers
Quoted 4 lines

If the shell test directory isn't present the exit code will be 255 but with no error messages printed. Add an error message.

Thanks, applied.

- Arnaldo

Quoted 28 lines

thanks,
jirka

Quoted 24 lines
---
 tools/perf/tests/builtin-test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/perf/tests/builtin-test.c +4 -1
index 5f05db75cdd8..54d9516c9839 100644
@@ -543,8 +543,11 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width)
 		return -1;
 
 	dir = opendir(st.dir);
-	if (!dir)
+	if (!dir) {
+		pr_err("failed to open shell test directory: %s\n",
+			st.dir);
 		return -1;
+	}
 
 	for_each_shell_test(dir, st.dir, ent) {
 		int curr = i++;
Signature · 1 line
2.25.1.481.gfbce0eb801-goog
Signature · 1 line
- Arnaldo
merge bot Applied
#3 lore raw

[tip: perf/core] perf test: Print if shell directory isn't present

In reply to Ian Rogers
The following commit has been merged into the perf/core branch of tip:

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     b2bf6660709c3bdd92d7558f4aa3cf07c0b0dda8
Gitweb:        https://git.kernel.org/tip/b2bf6660709c3bdd92d7558f4aa3cf07c0b0dda8
Author:        Ian Rogers <[email protected]>
AuthorDate:    Thu, 12 Mar 2020 17:56:02 -07:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Fri, 13 Mar 2020 15:43:43 -03:00

perf test: Print if shell directory isn't present

If the shell test directory isn't present the exit code will be 255 but with no error messages printed. Add an error message.

---
 tools/perf/tests/builtin-test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/perf/tests/builtin-test.c +4 -1
index 5f05db7..54d9516 100644
@@ -543,8 +543,11 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width)
 		return -1;
 
 	dir = opendir(st.dir);
-	if (!dir)
+	if (!dir) {
+		pr_err("failed to open shell test directory: %s\n",
+			st.dir);
 		return -1;
+	}
 
 	for_each_shell_test(dir, st.dir, ent) {
 		int curr = i++;