OSDN Git Service

perf test: Print if shell directory isn't present
authorIan Rogers <irogers@google.com>
Fri, 13 Mar 2020 00:56:02 +0000 (17:56 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 13 Mar 2020 18:43:43 +0000 (15:43 -0300)
If the shell test directory isn't present the exit code will be 255 but
with no error messages printed. Add an error message.

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20200313005602.45236-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/builtin-test.c

index 5f05db7..54d9516 100644 (file)
@@ -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++;