selftests/bpf: Extend map-in-map selftest to detect memory leaks
authorAndrii Nakryiko <andriin@fb.com>
Wed, 29 Jul 2020 04:09:13 +0000 (21:09 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 29 Jul 2020 23:30:26 +0000 (01:30 +0200)
commit0ba58348414eb10249480635545758b40b3c33b6
treecb6f2183d57cb567b728fb8583efa0009089196b
parent1d4e1eab456e1ee92a94987499b211db05f900ea
selftests/bpf: Extend map-in-map selftest to detect memory leaks

Add test validating that all inner maps are released properly after skeleton
is destroyed. To ensure determinism, trigger kernel-side synchronize_rcu()
before checking map existence by their IDs.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20200729040913.2815687-2-andriin@fb.com
tools/testing/selftests/bpf/prog_tests/btf_map_in_map.c