linux/tools/testing/selftests/bpf/bpf_testmod
Kui-Feng Lee 0623e73317 selftests/bpf: Test if shadow types work correctly.
Change the values of fields, including scalar types and function pointers,
and check if the struct_ops map works as expected.

The test changes the field "test_2" of "testmod_1" from the pointer to
test_2() to pointer to test_3() and the field "data" to 13. The function
test_2() and test_3() both compute a new value for "test_2_result", but in
different way. By checking the value of "test_2_result", it ensures the
struct_ops map works as expected with changes through shadow types.

Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240229064523.2091270-6-thinker.li@gmail.com
2024-02-29 14:23:53 -08:00
..
.gitignore
bpf_testmod-events.h bpf/selftests: Add test for writable bare tracepoint 2021-10-08 13:22:57 -07:00
bpf_testmod.c selftests/bpf: Test if shadow types work correctly. 2024-02-29 14:23:53 -08:00
bpf_testmod.h selftests/bpf: Test if shadow types work correctly. 2024-02-29 14:23:53 -08:00
bpf_testmod_kfunc.h selftests/bpf: Add test for missed counts of perf event link kprobe 2023-09-25 16:37:44 -07:00
Makefile