Files
linux-stable-mirror/tools/testing/selftests/bpf/progs/tracing_multi_attach.c
T
Jiri OlsaandAlexei Starovoitov 2922dd5841 selftests/bpf: Add tracing multi skel/pattern/ids attach tests
Adding tests for tracing_multi link attachment via all possible
libbpf apis - skeleton, function pattern and btf ids.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20260606123955.345967-22-jolsa@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-06-07 10:03:02 -07:00

40 lines
862 B
C

// SPDX-License-Identifier: GPL-2.0
#include <vmlinux.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
char _license[] SEC("license") = "GPL";
__hidden extern int tracing_multi_arg_check(__u64 *ctx, __u64 *test_result, bool is_return);
__u64 test_result_fentry = 0;
__u64 test_result_fexit = 0;
SEC("fentry.multi/bpf_fentry_test*")
int BPF_PROG(test_fentry)
{
tracing_multi_arg_check(ctx, &test_result_fentry, false);
return 0;
}
SEC("fexit.multi/bpf_fentry_test*")
int BPF_PROG(test_fexit)
{
tracing_multi_arg_check(ctx, &test_result_fexit, true);
return 0;
}
SEC("fentry.multi.s/bpf_fentry_test1")
int BPF_PROG(test_fentry_s)
{
tracing_multi_arg_check(ctx, &test_result_fentry, false);
return 0;
}
SEC("fexit.multi.s/bpf_fentry_test1")
int BPF_PROG(test_fexit_s)
{
tracing_multi_arg_check(ctx, &test_result_fexit, true);
return 0;
}