1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2019 Facebook
6 #include "bpf_helpers.h"
8 char _license
[] SEC("license") = "GPL";
10 static volatile struct data
{
15 enum core_reloc_primitives_enum
{
20 struct core_reloc_primitives
{
23 enum core_reloc_primitives_enum c
;
25 int (*f
)(const char *);
28 SEC("raw_tracepoint/sys_enter")
29 int test_core_primitives(void *ctx
)
31 struct core_reloc_primitives
*in
= (void *)&data
.in
;
32 struct core_reloc_primitives
*out
= (void *)&data
.out
;
34 if (BPF_CORE_READ(&out
->a
, &in
->a
) ||
35 BPF_CORE_READ(&out
->b
, &in
->b
) ||
36 BPF_CORE_READ(&out
->c
, &in
->c
) ||
37 BPF_CORE_READ(&out
->d
, &in
->d
) ||
38 BPF_CORE_READ(&out
->f
, &in
->f
))