1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) Meta Platforms, Inc. and affiliates. */
6 #include <bpf/bpf_helpers.h>
8 /* volatile to force a read */
9 const volatile int var1;
10 volatile int var2 = 1;
17 extern volatile bool CONFIG_BPF_SYSCALL __kconfig;
21 __weak int var5 SEC(".data");
23 /* Fully contained within library extern-and-definition */
26 int var7 SEC(".data.custom");
31 __uint(type, BPF_MAP_TYPE_HASH);
34 __uint(max_entries, 16);
38 __uint(type, BPF_MAP_TYPE_HASH);
41 __uint(max_entries, 16);
46 __u32 key = 1, value = 2;
48 (void) CONFIG_BPF_SYSCALL;
49 bpf_map_update_elem(&map2, &key, &value, BPF_ANY);
51 libout1 = var1 + var2 + var3.var3_1 + var3.var3_2 + var5 + var6;
56 int lib_perf_handler(struct pt_regs *ctx)
61 char LICENSE[] SEC("license") = "GPL";