perf test bpf: Skip test if clang is not present
[linux-2.6-microblaze.git] / tools / perf / tests / bpf.c
index 57b9591..17c0238 100644 (file)
@@ -222,11 +222,11 @@ static int __test__bpf(int idx)
 
        ret = test_llvm__fetch_bpf_obj(&obj_buf, &obj_buf_sz,
                                       bpf_testcase_table[idx].prog_id,
-                                      true, NULL);
+                                      false, NULL);
        if (ret != TEST_OK || !obj_buf || !obj_buf_sz) {
                pr_debug("Unable to get BPF object, %s\n",
                         bpf_testcase_table[idx].msg_compile_fail);
-               if (idx == 0)
+               if ((idx == 0) || (ret == TEST_SKIP))
                        return TEST_SKIP;
                else
                        return TEST_FAIL;
@@ -364,9 +364,11 @@ static int test__bpf_prologue_test(struct test_suite *test __maybe_unused,
 static struct test_case bpf_tests[] = {
 #ifdef HAVE_LIBBPF_SUPPORT
        TEST_CASE("Basic BPF filtering", basic_bpf_test),
-       TEST_CASE("BPF pinning", bpf_pinning),
+       TEST_CASE_REASON("BPF pinning", bpf_pinning,
+                       "clang isn't installed or environment missing BPF support"),
 #ifdef HAVE_BPF_PROLOGUE
-       TEST_CASE("BPF prologue generation", bpf_prologue_test),
+       TEST_CASE_REASON("BPF prologue generation", bpf_prologue_test,
+                       "clang isn't installed or environment missing BPF support"),
 #else
        TEST_CASE_REASON("BPF prologue generation", bpf_prologue_test, "not compiled in"),
 #endif