summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/tracing_struct_many_args.c
blob: 3de4bb9181784ba62539f7dfa62b165b44d73756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// SPDX-License-Identifier: GPL-2.0
#include <vmlinux.h>
#include <bpf/bpf_tracing.h>
#include <bpf/bpf_helpers.h>

struct bpf_testmod_struct_arg_4 {
	u64 a;
	int b;
};

long t7_a, t7_b, t7_c, t7_d, t7_e, t7_f_a, t7_f_b, t7_ret;
long t8_a, t8_b, t8_c, t8_d, t8_e, t8_f_a, t8_f_b, t8_g, t8_ret;

SEC("fentry/bpf_testmod_test_struct_arg_7")
int BPF_PROG2(test_struct_many_args_1, __u64, a, void *, b, short, c, int, d,
	      void *, e, struct bpf_testmod_struct_arg_4, f)
{
	t7_a = a;
	t7_b = (long)b;
	t7_c = c;
	t7_d = d;
	t7_e = (long)e;
	t7_f_a = f.a;
	t7_f_b = f.b;
	return 0;
}

SEC("fexit/bpf_testmod_test_struct_arg_7")
int BPF_PROG2(test_struct_many_args_2, __u64, a, void *, b, short, c, int, d,
	      void *, e, struct bpf_testmod_struct_arg_4, f, int, ret)
{
	t7_ret = ret;
	return 0;
}

SEC("fentry/bpf_testmod_test_struct_arg_8")
int BPF_PROG2(test_struct_many_args_3, __u64, a, void *, b, short, c, int, d,
	      void *, e, struct bpf_testmod_struct_arg_4, f, int, g)
{
	t8_a = a;
	t8_b = (long)b;
	t8_c = c;
	t8_d = d;
	t8_e = (long)e;
	t8_f_a = f.a;
	t8_f_b = f.b;
	t8_g = g;
	return 0;
}

SEC("fexit/bpf_testmod_test_struct_arg_8")
int BPF_PROG2(test_struct_many_args_4, __u64, a, void *, b, short, c, int, d,
	      void *, e, struct bpf_testmod_struct_arg_4, f, int, g,
	      int, ret)
{
	t8_ret = ret;
	return 0;
}

char _license[] SEC("license") = "GPL";