Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/bpf: Bail out quickly from failing consumer test

Let's bail out from consumer test after we hit first fail,
so we don't pollute the log with many instances with possibly
the same error.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Jiri Olsa and committed by
Alexei Starovoitov
58dbb369 4b7c0559

+11 -5
+11 -5
tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c
··· 836 836 return 0; 837 837 } 838 838 839 - static void consumer_test(struct uprobe_multi_consumers *skel, 840 - unsigned long before, unsigned long after) 839 + static int consumer_test(struct uprobe_multi_consumers *skel, 840 + unsigned long before, unsigned long after) 841 841 { 842 - int err, idx; 842 + int err, idx, ret = -1; 843 843 844 844 printf("consumer_test before %lu after %lu\n", before, after); 845 845 ··· 881 881 fmt = "idx 2/3: uretprobe"; 882 882 } 883 883 884 - ASSERT_EQ(skel->bss->uprobe_result[idx], val, fmt); 884 + if (!ASSERT_EQ(skel->bss->uprobe_result[idx], val, fmt)) 885 + goto cleanup; 885 886 skel->bss->uprobe_result[idx] = 0; 886 887 } 888 + 889 + ret = 0; 887 890 888 891 cleanup: 889 892 for (idx = 0; idx < 4; idx++) 890 893 uprobe_detach(skel, idx); 894 + return ret; 891 895 } 892 896 893 897 static void test_consumers(void) ··· 943 939 944 940 for (before = 0; before < 16; before++) { 945 941 for (after = 0; after < 16; after++) 946 - consumer_test(skel, before, after); 942 + if (consumer_test(skel, before, after)) 943 + goto out; 947 944 } 948 945 946 + out: 949 947 uprobe_multi_consumers__destroy(skel); 950 948 } 951 949