selftests/bpf: Add bpf_testmod kernel module for testing
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 3 Dec 2020 20:46:26 +0000 (12:46 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 4 Dec 2020 01:38:20 +0000 (17:38 -0800)
commit9f7fa225894c7fcb014f3699a402fcc4d896cb1c
treeedf41331c46aa34ac41b9b1545b112575a112edc
parent4f33a53d56000cfa67e2e4e8a5dac08f084a979b
selftests/bpf: Add bpf_testmod kernel module for testing

Add bpf_testmod module, which is conceptually out-of-tree module and provides
ways for selftests/bpf to test various kernel module-related functionality:
raw tracepoint, fentry/fexit/fmod_ret, etc. This module will be auto-loaded by
test_progs test runner and expected by some of selftests to be present and
loaded.

Pahole currently isn't able to generate BTF for static functions in kernel
modules, so make sure traced function is global.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20201203204634.1325171-7-andrii@kernel.org
tools/testing/selftests/bpf/.gitignore
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/bpf_testmod/.gitignore [new file with mode: 0644]
tools/testing/selftests/bpf/bpf_testmod/Makefile [new file with mode: 0644]
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod-events.h [new file with mode: 0644]
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c [new file with mode: 0644]
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h [new file with mode: 0644]
tools/testing/selftests/bpf/test_progs.c
tools/testing/selftests/bpf/test_progs.h