bpf/selftests: coverage for tp and perf event progs using kfuncs

This coverage ensures that kfuncs are allowed within tracepoint and perf
event programs.

Signed-off-by: JP Kobryn <inwardvessel@gmail.com>
Link: https://lore.kernel.org/r/20240905223812.141857-3-inwardvessel@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
JP Kobryn 2024-09-05 15:38:12 -07:00 committed by Alexei Starovoitov
parent bc638d8cb5
commit 1b3bc648f5

View File

@ -47,6 +47,22 @@ int BPF_PROG(task_kfunc_syscall)
return 0;
}
SEC("tracepoint")
__success
int BPF_PROG(task_kfunc_tracepoint)
{
task_kfunc_load_test();
return 0;
}
SEC("perf_event")
__success
int BPF_PROG(task_kfunc_perf_event)
{
task_kfunc_load_test();
return 0;
}
/*****************
* cgroup kfuncs *
*****************/
@ -85,6 +101,22 @@ int BPF_PROG(cgrp_kfunc_syscall)
return 0;
}
SEC("tracepoint")
__success
int BPF_PROG(cgrp_kfunc_tracepoint)
{
cgrp_kfunc_load_test();
return 0;
}
SEC("perf_event")
__success
int BPF_PROG(cgrp_kfunc_perf_event)
{
cgrp_kfunc_load_test();
return 0;
}
/******************
* cpumask kfuncs *
******************/
@ -120,3 +152,19 @@ int BPF_PROG(cpumask_kfunc_syscall)
cpumask_kfunc_load_test();
return 0;
}
SEC("tracepoint")
__success
int BPF_PROG(cpumask_kfunc_tracepoint)
{
cpumask_kfunc_load_test();
return 0;
}
SEC("perf_event")
__success
int BPF_PROG(cpumask_kfunc_perf_event)
{
cpumask_kfunc_load_test();
return 0;
}