selftests/bpf: retry tests that expect build-id
authorStanislav Fomichev <sdf@google.com>
Wed, 16 Jan 2019 22:03:17 +0000 (14:03 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:08:56 +0000 (10:08 +0100)
commit22b304bfcb009c847ff920893c317ff863ab504a
treea4692a1ded34e7ce80277264c03b5ff5a7dc47e9
parent5c6fdd877eff1f84ae6c637cd7a436c40c1aa548
selftests/bpf: retry tests that expect build-id

[ Upstream commit f67ad87ab3120e82845521b18a2b99273a340308 ]

While running test_progs in a loop I found out that I'm sometimes hitting
"Didn't find expected build ID from the map" error.

Looking at stack_map_get_build_id_offset() it seems that it is racy (by
design) and can sometimes return BPF_STACK_BUILD_ID_IP (i.e. can't trylock
current->mm->mmap_sem).

Let's retry this test a single time.

Fixes: 13790d1cc72c ("bpf: add selftest for stackmap with build_id in NMI context")
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/test_progs.c