This source file includes following definitions.
- SEC
1
2
3
4 #include <linux/bpf.h>
5 #include <stdint.h>
6 #include "bpf_helpers.h"
7
8 char _license[] SEC("license") = "GPL";
9
10 static volatile struct data {
11 char in[256];
12 char out[256];
13 } data;
14
15 struct core_reloc_ptr_as_arr {
16 int a;
17 };
18
19 SEC("raw_tracepoint/sys_enter")
20 int test_core_ptr_as_arr(void *ctx)
21 {
22 struct core_reloc_ptr_as_arr *in = (void *)&data.in;
23 struct core_reloc_ptr_as_arr *out = (void *)&data.out;
24
25 if (BPF_CORE_READ(&out->a, &in[2].a))
26 return 1;
27
28 return 0;
29 }
30