mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 14:42:08 +02:00
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>
This commit is contained in:
parent
4b7c05598a
commit
58dbb36930
|
|
@ -836,10 +836,10 @@ uprobe_consumer_test(struct uprobe_multi_consumers *skel,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void consumer_test(struct uprobe_multi_consumers *skel,
|
||||
unsigned long before, unsigned long after)
|
||||
static int consumer_test(struct uprobe_multi_consumers *skel,
|
||||
unsigned long before, unsigned long after)
|
||||
{
|
||||
int err, idx;
|
||||
int err, idx, ret = -1;
|
||||
|
||||
printf("consumer_test before %lu after %lu\n", before, after);
|
||||
|
||||
|
|
@ -881,13 +881,17 @@ static void consumer_test(struct uprobe_multi_consumers *skel,
|
|||
fmt = "idx 2/3: uretprobe";
|
||||
}
|
||||
|
||||
ASSERT_EQ(skel->bss->uprobe_result[idx], val, fmt);
|
||||
if (!ASSERT_EQ(skel->bss->uprobe_result[idx], val, fmt))
|
||||
goto cleanup;
|
||||
skel->bss->uprobe_result[idx] = 0;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
for (idx = 0; idx < 4; idx++)
|
||||
uprobe_detach(skel, idx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void test_consumers(void)
|
||||
|
|
@ -939,9 +943,11 @@ static void test_consumers(void)
|
|||
|
||||
for (before = 0; before < 16; before++) {
|
||||
for (after = 0; after < 16; after++)
|
||||
consumer_test(skel, before, after);
|
||||
if (consumer_test(skel, before, after))
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
uprobe_multi_consumers__destroy(skel);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user