summaryrefslogtreecommitdiffstats
path: root/tools/perf/tests
diff options
context:
space:
mode:
authorWang Nan <wangnan0@huawei.com>2016-11-26 07:03:38 +0000
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-12-05 15:51:44 -0300
commit5e08a76525b8f5e9aeb8b27d0466614abec070a9 (patch)
tree9b63f3b0fb1c35248e51c4b4f2aadf3ab68db6aa /tools/perf/tests
parente67d52d411c3562263735479db2efd2ebd178db9 (diff)
downloadlinux-5e08a76525b8f5e9aeb8b27d0466614abec070a9.tar.bz2
perf clang: Support compile IR to BPF object and add testcase
getBPFObjectFromModule() is introduced to compile LLVM IR(Module) to BPF object. Add new testcase for it. Test result: $ ./buildperf/perf test -v clang 51: builtin clang support : 51.1: builtin clang compile C source to IR : --- start --- test child forked, pid 21822 test child finished with 0 ---- end ---- builtin clang support subtest 0: Ok 51.2: builtin clang compile C source to ELF object : --- start --- test child forked, pid 21823 test child finished with 0 ---- end ---- builtin clang support subtest 1: Ok Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Stringer <joe@ovn.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/20161126070354.141764-15-wangnan0@huawei.com [ Remove redundant "Test" from entry descriptions ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests')
-rw-r--r--tools/perf/tests/clang.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/tests/clang.c b/tools/perf/tests/clang.c
index 636d6d0e9037..f853e242a86c 100644
--- a/tools/perf/tests/clang.c
+++ b/tools/perf/tests/clang.c
@@ -12,6 +12,10 @@ static struct {
.func = test__clang_to_IR,
.desc = "builtin clang compile C source to IR",
},
+ {
+ .func = test__clang_to_obj,
+ .desc = "builtin clang compile C source to ELF object",
+ },
#endif
};
@@ -33,7 +37,7 @@ int test__clang(int i __maybe_unused)
return TEST_SKIP;
}
#else
-int test__clang(int i __maybe_unused)
+int test__clang(int i)
{
if (i < 0 || i >= (int)ARRAY_SIZE(clang_testcase_table))
return TEST_FAIL;