]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Drain ringbuf samples at the end of test
authorAndrii Nakryiko <andrii@kernel.org>
Mon, 30 Nov 2020 22:33:36 +0000 (14:33 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 2 Dec 2020 04:21:45 +0000 (20:21 -0800)
commit1a362715d7405683734008897ca8e9db6f4ce428
tree5ef1dc75822e68a83311adc091398f4ded990c19
parent6f81b059cd141ffcb31e5a819cf274c6ba42b8d6
selftests/bpf: Drain ringbuf samples at the end of test

Avoid occasional test failures due to the last sample being delayed to
another ring_buffer__poll() call. Instead, drain samples completely with
ring_buffer__consume(). This is supposed to fix a rare and non-deterministic
test failure in libbpf CI.

Fixes: 135e3913edae ("selftests/bpf: Add BPF ringbuf selftests")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201130223336.904192-2-andrii@kernel.org
tools/testing/selftests/bpf/prog_tests/ringbuf.c