aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/free_timer.c
diff options
context:
space:
mode:
authorLeon Hwang <leon.hwang@linux.dev>2025-09-10 20:57:40 +0800
committerAlexei Starovoitov <ast@kernel.org>2025-09-10 12:34:09 -0700
commitfbdd61c94bcb09b0c0eb0655917bf4193d07aac1 (patch)
tree0bfc9adba37a9dbaabd25dca559e320a729117a6 /tools/testing/selftests/bpf/prog_tests/free_timer.c
parentbpf: Reject bpf_timer for PREEMPT_RT (diff)
downloadlinux-fbdd61c94bcb09b0c0eb0655917bf4193d07aac1.tar.gz
linux-fbdd61c94bcb09b0c0eb0655917bf4193d07aac1.zip
selftests/bpf: Skip timer cases when bpf_timer is not supported
When enable CONFIG_PREEMPT_RT, verifier will reject bpf_timer with returning -EOPNOTSUPP. Therefore, skip test cases when errno is EOPNOTSUPP. cd tools/testing/selftests/bpf ./test_progs -t timer 125 free_timer:SKIP 456 timer:SKIP 457/1 timer_crash/array:SKIP 457/2 timer_crash/hash:SKIP 457 timer_crash:SKIP 458 timer_lockup:SKIP 459 timer_mim:SKIP Summary: 5/0 PASSED, 6 SKIPPED, 0 FAILED Signed-off-by: Leon Hwang <leon.hwang@linux.dev> Link: https://lore.kernel.org/r/20250910125740.52172-3-leon.hwang@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/free_timer.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/free_timer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/free_timer.c b/tools/testing/selftests/bpf/prog_tests/free_timer.c
index b7b77a6b2979..0de8facca4c5 100644
--- a/tools/testing/selftests/bpf/prog_tests/free_timer.c
+++ b/tools/testing/selftests/bpf/prog_tests/free_timer.c
@@ -124,6 +124,10 @@ void test_free_timer(void)
int err;
skel = free_timer__open_and_load();
+ if (!skel && errno == EOPNOTSUPP) {
+ test__skip();
+ return;
+ }
if (!ASSERT_OK_PTR(skel, "open_load"))
return;