diff options
author | Wang Nan <wangnan0@huawei.com> | 2015-11-17 08:32:48 +0000 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-11-19 13:19:16 -0300 |
commit | e8c6d500447c577e669c24ec04cd4173fe9f9afb (patch) | |
tree | 208f33d94d5e1fe66a778515aa334a45d2d0a7d8 /tools/perf/tests/tests.h | |
parent | 721a1f53df6aad3ea941f5fe95519d0d8e02bd65 (diff) | |
download | linux-e8c6d500447c577e669c24ec04cd4173fe9f9afb.tar.bz2 |
perf test: Print result for each LLVM subtest
Currently 'perf test llvm' and 'perf test BPF' have multiple sub-tests,
but the result is provided in only one line:
# perf test LLVM
35: Test LLVM searching and compiling : Ok
This patch introduces sub-tests support, allowing 'perf test' to report
result for each sub-tests:
# perf test LLVM
35: Test LLVM searching and compiling :
35.1: Basic BPF llvm compiling test : Ok
35.2: Test kbuild searching : Ok
35.3: Compile source for BPF prologue generation test : Ok
When a failure happens:
# cat ~/.perfconfig
[llvm]
clang-path = "/bin/false"
# perf test LLVM
35: Test LLVM searching and compiling :
35.1: Basic BPF llvm compiling test : FAILED!
35.2: Test kbuild searching : Skip
35.3: Compile source for BPF prologue generation test : Skip
And:
# rm ~/.perfconfig
# ./perf test LLVM
35: Test LLVM searching and compiling :
35.1: Basic BPF llvm compiling test : Skip
35.2: Test kbuild searching : Skip
35.3: Compile source for BPF prologue generation test : Skip
Skip by user:
# ./perf test -s 1,`seq -s , 3 42`
1: vmlinux symtab matches kallsyms : Skip (user override)
2: detect openat syscall event : Ok
...
35: Test LLVM searching and compiling : Skip (user override)
...
Suggested-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1447749170-175898-4-git-send-email-wangnan0@huawei.com
[ Changed so that func is not on an anonymous union ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/tests.h')
-rw-r--r-- | tools/perf/tests/tests.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h index 204e4eeadea2..f92af527f080 100644 --- a/tools/perf/tests/tests.h +++ b/tools/perf/tests/tests.h @@ -1,6 +1,8 @@ #ifndef TESTS_H #define TESTS_H +#include <stdbool.h> + #define TEST_ASSERT_VAL(text, cond) \ do { \ if (!(cond)) { \ @@ -27,6 +29,11 @@ enum { struct test { const char *desc; int (*func)(int subtest); + struct { + bool skip_if_fail; + int (*get_nr)(void); + const char *(*get_desc)(int subtest); + } subtest; }; /* Tests */ @@ -66,6 +73,8 @@ int test__fdarray__add(int subtest); int test__kmod_path__parse(int subtest); int test__thread_map(int subtest); int test__llvm(int subtest); +const char *test__llvm_subtest_get_desc(int subtest); +int test__llvm_subtest_get_nr(void); int test__bpf(int subtest); int test_session_topology(int subtest); |