Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at master 44 lines 728 B view raw
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 8char _license[] SEC("license") = "GPL"; 9 10void bpf_testmod_ops3_call_test_1(void) __ksym; 11 12int val_i, val_j; 13 14__noinline static int subprog2(int *a, int *b) 15{ 16 return val_i + a[1] + b[20]; 17} 18 19__noinline static int subprog1(int *a) 20{ 21 /* stack size 400 bytes */ 22 int b[100] = {}; 23 24 b[20] = 2; 25 return subprog2(a, b); 26} 27 28 29SEC("struct_ops") 30int BPF_PROG(test_1) 31{ 32 /* stack size 20 bytes */ 33 int a[5] = {}; 34 35 a[1] = 1; 36 val_j += subprog1(a); 37 bpf_testmod_ops3_call_test_1(); 38 return 0; 39} 40 41SEC(".struct_ops") 42struct bpf_testmod_ops3 testmod_1 = { 43 .test_1 = (void *)test_1, 44};