1 // SPDX-License-Identifier: GPL-2.0 2 3 #include <vmlinux.h> 4 #include <bpf/bpf_helpers.h> 5 #include <bpf/bpf_tracing.h> 6 #include "../test_kmods/bpf_testmod.h" 7 8 char _license[] SEC("license") = "GPL"; 9 10 #if defined(__TARGET_ARCH_x86) 11 bool skip __attribute((__section__(".data"))) = false; 12 #else 13 bool skip = true; 14 #endif 15 16 void bpf_testmod_ops3_call_test_1(void) __ksym; 17 18 int val_i, val_j; 19 subprog2(int * a,int * b)20__noinline static int subprog2(int *a, int *b) 21 { 22 return val_i + a[1] + b[20]; 23 } 24 subprog1(int * a)25__noinline static int subprog1(int *a) 26 { 27 /* stack size 400 bytes */ 28 int b[100] = {}; 29 30 b[20] = 2; 31 return subprog2(a, b); 32 } 33 34 35 SEC("struct_ops") BPF_PROG(test_1)36int BPF_PROG(test_1) 37 { 38 /* stack size 20 bytes */ 39 int a[5] = {}; 40 41 a[1] = 1; 42 val_j += subprog1(a); 43 bpf_testmod_ops3_call_test_1(); 44 return 0; 45 } 46 47 SEC(".struct_ops") 48 struct bpf_testmod_ops3 testmod_1 = { 49 .test_1 = (void *)test_1, 50 }; 51