summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/test_pe_preserve_elems.c
Commit message (Collapse)AuthorAgeFilesLines
* selftests/bpf: Use BTF-defined key/value for map definitionsHengqi Chen2021-10-011-4/+4
| | | | | | | | | | Change map definitions in BPF selftests to use BTF-defined key/value types. This unifies the map definitions and ensures libbpf won't emit warning about retrying map creation. Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20210930161456.3444544-3-hengqi.chen@gmail.com
* selftests/bpf: Add tests for BPF_F_PRESERVE_ELEMSSong Liu2020-09-301-0/+38
Add tests for perf event array with and without BPF_F_PRESERVE_ELEMS. Add a perf event to array via fd mfd. Without BPF_F_PRESERVE_ELEMS, the perf event is removed when mfd is closed. With BPF_F_PRESERVE_ELEMS, the perf event is removed when the map is freed. Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200930224927.1936644-3-songliubraving@fb.com