1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2019 Facebook */
3 
4 #include <stdbool.h>
5 #include <linux/bpf.h>
6 #include <bpf/bpf_helpers.h>
7 
8 struct s {
9 	int a;
10 	long long b;
11 } __attribute__((packed));
12 
13 int in1 = 0;
14 long long in2 = 0;
15 char in3 = '\0';
16 long long in4 __attribute__((aligned(64))) = 0;
17 struct s in5 = {};
18 
19 long long out2 = 0;
20 char out3 = 0;
21 long long out4 = 0;
22 int out1 = 0;
23 
24 extern bool CONFIG_BPF_SYSCALL __kconfig;
25 extern int LINUX_KERNEL_VERSION __kconfig;
26 bool bpf_syscall = 0;
27 int kern_ver = 0;
28 
29 SEC("raw_tp/sys_enter")
30 int handler(const void *ctx)
31 {
32 	static volatile struct s out5;
33 
34 	out1 = in1;
35 	out2 = in2;
36 	out3 = in3;
37 	out4 = in4;
38 	out5 = in5;
39 
40 	bpf_syscall = CONFIG_BPF_SYSCALL;
41 	kern_ver = LINUX_KERNEL_VERSION;
42 
43 	return 0;
44 }
45 
46 char _license[] SEC("license") = "GPL";
47