arm64 now supports dynamic ftrace direct calls backed by a single ftrace_ops, which enables BPF tracing multi links.
Define ARCH_SUPPORTS_TRACING_MULTI_LINK for x86-64 and arm64, and use the shared capability to gate the tracing_multi functional, rollback, and attach benchmark tests. This allows the tests to run on arm64 while continuing to skip architectures without tracing multi link support. It also prevents the rollback test from treating an unsupported-link error as its expected attachment failure. Assisted-by: Codex:gpt-5.6-sol Signed-off-by: Leon Hwang <[email protected]> --- tools/testing/selftests/bpf/prog_tests/tracing_multi.c | 9 +++++++-- tools/testing/selftests/bpf/test_progs.h | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/tracing_multi.c b/tools/testing/selftests/bpf/prog_tests/tracing_multi.c index f02ffc7f41d7..5aa48e090340 100644 --- a/tools/testing/selftests/bpf/prog_tests/tracing_multi.c +++ b/tools/testing/selftests/bpf/prog_tests/tracing_multi.c @@ -612,7 +612,7 @@ void serial_test_tracing_multi_bench_attach(void) struct btf *btf; int err; -#ifndef __x86_64__ +#if !ARCH_SUPPORTS_TRACING_MULTI_LINK test__skip(); return; #endif @@ -923,6 +923,11 @@ static void test_rollback_unlink(void) void serial_test_tracing_multi_attach_rollback(void) { +#if !ARCH_SUPPORTS_TRACING_MULTI_LINK + test__skip(); + return; +#endif + if (test__start_subtest("put")) test_rollback_put(); if (test__start_subtest("unlink")) @@ -931,7 +936,7 @@ void serial_test_tracing_multi_attach_rollback(void) void test_tracing_multi_test(void) { -#ifndef __x86_64__ +#if !ARCH_SUPPORTS_TRACING_MULTI_LINK test__skip(); return; #endif diff --git a/tools/testing/selftests/bpf/test_progs.h b/tools/testing/selftests/bpf/test_progs.h index 2cf950afcd85..b1498e84773c 100644 --- a/tools/testing/selftests/bpf/test_progs.h +++ b/tools/testing/selftests/bpf/test_progs.h @@ -567,4 +567,10 @@ void validate_msgs(const char *log_buf, struct expected_msgs *msgs, void free_msgs(struct expected_msgs *msgs); void verify_test_stderr(struct bpf_object *obj, struct bpf_program *prog); +#if defined(__x86_64__) || defined(__aarch64__) +#define ARCH_SUPPORTS_TRACING_MULTI_LINK 1 +#else +#define ARCH_SUPPORTS_TRACING_MULTI_LINK 0 +#endif + #endif /* __TEST_PROGS_H */ -- 2.55.0
