1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2019 Facebook
6 #include <bpf/bpf_helpers.h>
7 #include <bpf/bpf_core_read.h>
9 char _license[] SEC("license") = "GPL";
16 struct core_reloc_nesting_substruct {
20 union core_reloc_nesting_subunion {
24 /* int a.a.a and b.b.b accesses */
25 struct core_reloc_nesting {
27 struct core_reloc_nesting_substruct a;
30 union core_reloc_nesting_subunion b;
34 #define CORE_READ(dst, src) bpf_core_read(dst, sizeof(*(dst)), src)
36 SEC("raw_tracepoint/sys_enter")
37 int test_core_nesting(void *ctx)
39 struct core_reloc_nesting *in = (void *)&data.in;
40 struct core_reloc_nesting *out = (void *)&data.out;
42 if (CORE_READ(&out->a.a.a, &in->a.a.a))
44 if (CORE_READ(&out->b.b.b, &in->b.b.b))