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