Commit 1b3bc648 authored by JP Kobryn's avatar JP Kobryn Committed by Alexei Starovoitov

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: default avatarJP Kobryn <inwardvessel@gmail.com>
Link: https://lore.kernel.org/r/20240905223812.141857-3-inwardvessel@gmail.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent bc638d8c
......@@ -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;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment