selftests/bpf: Add custom SEC() handling selftest
authorAndrii Nakryiko <andrii@kernel.org>
Sat, 5 Mar 2022 01:01:29 +0000 (17:01 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 5 Mar 2022 17:38:15 +0000 (09:38 -0800)
commitaa963bcb0adc1adb79a97260fae55461359d1ed2
tree747d03d7ffb7833456ee26b4c556f35de7d8e487
parent697f104db8a6177daa5e1ffadda09c2e9285ad18
selftests/bpf: Add custom SEC() handling selftest

Add a selftest validating various aspects of libbpf's handling of custom
SEC() handlers. It also demonstrates how libraries can ensure very early
callbacks registration and unregistration using
__attribute__((constructor))/__attribute__((destructor)) functions.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Tested-by: Alan Maguire <alan.maguire@oracle.com>
Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
Link: https://lore.kernel.org/bpf/20220305010129.1549719-4-andrii@kernel.org
tools/testing/selftests/bpf/prog_tests/custom_sec_handlers.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_custom_sec_handlers.c [new file with mode: 0644]