aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/struct_ops_id_ops_mapping2.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2025-08-06selftests/bpf: Test multi_st_ops and calling kfuncs from different programsAmery Hung1-0/+59
Test multi_st_ops and demonstrate how different bpf programs can call a kfuncs that refers to the struct_ops instance in the same source file by id. The id is defined as a global vairable and initialized before attaching the skeleton. Kfuncs that take the id can hide the argument with a macro to make it almost transparent to bpf program developers. The test involves two struct_ops returning different values from .test_1. In syscall and tracing programs, check if the correct value is returned by a kfunc that calls .test_1. Signed-off-by: Amery Hung <ameryhung@gmail.com> Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Link: https://patch.msgid.link/20250806162540.681679-4-ameryhung@gmail.com