selftests/bpf: test_progs: remove global fail/success counts
[muen/linux.git] / tools / testing / selftests / bpf / prog_tests / stacktrace_map.c
index fc53933..37269d2 100644 (file)
@@ -26,19 +26,19 @@ void test_stacktrace_map(void)
 
        /* find map fds */
        control_map_fd = bpf_find_map(__func__, obj, "control_map");
-       if (control_map_fd < 0)
+       if (CHECK_FAIL(control_map_fd < 0))
                goto disable_pmu;
 
        stackid_hmap_fd = bpf_find_map(__func__, obj, "stackid_hmap");
-       if (stackid_hmap_fd < 0)
+       if (CHECK_FAIL(stackid_hmap_fd < 0))
                goto disable_pmu;
 
        stackmap_fd = bpf_find_map(__func__, obj, "stackmap");
-       if (stackmap_fd < 0)
+       if (CHECK_FAIL(stackmap_fd < 0))
                goto disable_pmu;
 
        stack_amap_fd = bpf_find_map(__func__, obj, "stack_amap");
-       if (stack_amap_fd < 0)
+       if (CHECK_FAIL(stack_amap_fd < 0))
                goto disable_pmu;
 
        /* give some time for bpf program run */
@@ -55,23 +55,20 @@ void test_stacktrace_map(void)
        err = compare_map_keys(stackid_hmap_fd, stackmap_fd);
        if (CHECK(err, "compare_map_keys stackid_hmap vs. stackmap",
                  "err %d errno %d\n", err, errno))
-               goto disable_pmu_noerr;
+               goto disable_pmu;
 
        err = compare_map_keys(stackmap_fd, stackid_hmap_fd);
        if (CHECK(err, "compare_map_keys stackmap vs. stackid_hmap",
                  "err %d errno %d\n", err, errno))
-               goto disable_pmu_noerr;
+               goto disable_pmu;
 
        stack_trace_len = PERF_MAX_STACK_DEPTH * sizeof(__u64);
        err = compare_stack_ips(stackmap_fd, stack_amap_fd, stack_trace_len);
        if (CHECK(err, "compare_stack_ips stackmap vs. stack_amap",
                  "err %d errno %d\n", err, errno))
-               goto disable_pmu_noerr;
+               goto disable_pmu;
 
-       goto disable_pmu_noerr;
 disable_pmu:
-       error_cnt++;
-disable_pmu_noerr:
        bpf_link__destroy(link);
 close_prog:
        bpf_object__close(obj);