1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2022 Meta Platforms, Inc. and affiliates. */
5 #include <bpf/bpf_tracing.h>
6 #include <bpf/bpf_helpers.h>
8 struct bpf_testmod_struct_arg_1 {
11 struct bpf_testmod_struct_arg_2 {
16 struct bpf_testmod_struct_arg_3 {
21 long t1_a_a, t1_a_b, t1_b, t1_c, t1_ret, t1_nregs;
22 __u64 t1_reg0, t1_reg1, t1_reg2, t1_reg3;
23 long t2_a, t2_b_a, t2_b_b, t2_c, t2_ret;
24 long t3_a, t3_b, t3_c_a, t3_c_b, t3_ret;
25 long t4_a_a, t4_b, t4_c, t4_d, t4_e_a, t4_e_b, t4_ret;
29 SEC("fentry/bpf_testmod_test_struct_arg_1")
30 int BPF_PROG2(test_struct_arg_1, struct bpf_testmod_struct_arg_2, a, int, b, int, c)
39 SEC("fexit/bpf_testmod_test_struct_arg_1")
40 int BPF_PROG2(test_struct_arg_2, struct bpf_testmod_struct_arg_2, a, int, b, int, c, int, ret)
42 t1_nregs = bpf_get_func_arg_cnt(ctx);
44 bpf_get_func_arg(ctx, 0, &t1_reg0);
46 bpf_get_func_arg(ctx, 1, &t1_reg1);
48 bpf_get_func_arg(ctx, 2, &t1_reg2);
49 t1_reg2 = (int)t1_reg2;
51 bpf_get_func_arg(ctx, 3, &t1_reg3);
52 t1_reg3 = (int)t1_reg3;
58 SEC("fentry/bpf_testmod_test_struct_arg_2")
59 int BPF_PROG2(test_struct_arg_3, int, a, struct bpf_testmod_struct_arg_2, b, int, c)
68 SEC("fexit/bpf_testmod_test_struct_arg_2")
69 int BPF_PROG2(test_struct_arg_4, int, a, struct bpf_testmod_struct_arg_2, b, int, c, int, ret)
75 SEC("fentry/bpf_testmod_test_struct_arg_3")
76 int BPF_PROG2(test_struct_arg_5, int, a, int, b, struct bpf_testmod_struct_arg_2, c)
85 SEC("fexit/bpf_testmod_test_struct_arg_3")
86 int BPF_PROG2(test_struct_arg_6, int, a, int, b, struct bpf_testmod_struct_arg_2, c, int, ret)
92 SEC("fentry/bpf_testmod_test_struct_arg_4")
93 int BPF_PROG2(test_struct_arg_7, struct bpf_testmod_struct_arg_1, a, int, b,
94 int, c, int, d, struct bpf_testmod_struct_arg_2, e)
105 SEC("fexit/bpf_testmod_test_struct_arg_4")
106 int BPF_PROG2(test_struct_arg_8, struct bpf_testmod_struct_arg_1, a, int, b,
107 int, c, int, d, struct bpf_testmod_struct_arg_2, e, int, ret)
113 SEC("fentry/bpf_testmod_test_struct_arg_5")
114 int BPF_PROG2(test_struct_arg_9)
119 SEC("fexit/bpf_testmod_test_struct_arg_5")
120 int BPF_PROG2(test_struct_arg_10, int, ret)
126 SEC("fentry/bpf_testmod_test_struct_arg_6")
127 int BPF_PROG2(test_struct_arg_11, struct bpf_testmod_struct_arg_3 *, a)
133 char _license[] SEC("license") = "GPL";