xref: /linux/tools/testing/selftests/bpf/progs/tracing_multi_attach_module.c (revision 68f4e480b089abae26fbab0c38c3df3cbac3d79d)
1 // SPDX-License-Identifier: GPL-2.0
2 #include <vmlinux.h>
3 #include <bpf/bpf_helpers.h>
4 #include <bpf/bpf_tracing.h>
5 
6 char _license[] SEC("license") = "GPL";
7 
8 __hidden extern int tracing_multi_arg_check(__u64 *ctx, __u64 *test_result, bool is_return);
9 
10 __u64 test_result_fentry = 0;
11 __u64 test_result_fexit = 0;
12 
13 SEC("fentry.multi/bpf_testmod:bpf_testmod_fentry_test*")
14 int BPF_PROG(test_fentry)
15 {
16 	tracing_multi_arg_check(ctx, &test_result_fentry, false);
17 	return 0;
18 }
19 
20 SEC("fexit.multi/bpf_testmod:bpf_testmod_fentry_test*")
21 int BPF_PROG(test_fexit)
22 {
23 	tracing_multi_arg_check(ctx, &test_result_fexit, true);
24 	return 0;
25 }
26