1 // SPDX-License-Identifier: GPL-2.0
5 #include <uapi/linux/bpf.h>
8 * A helper structure used by eBPF C program to describe map attributes to
9 * elf_bpf loader, taken from tools/testing/selftests/bpf/bpf_helpers.h:
13 unsigned int key_size;
14 unsigned int value_size;
15 unsigned int max_entries;
16 unsigned int map_flags;
17 unsigned int inner_map_idx;
18 unsigned int numa_node;
21 #define SEC(NAME) __attribute__((section(NAME), used))
23 #define probe(function, vars) \
24 SEC(#function "=" #function " " #vars) function
26 #define syscall_enter(name) \
27 SEC("syscalls:sys_enter_" #name) syscall_enter_ ## name
29 #define license(name) \
30 char _license[] SEC("license") = #name; \
31 int _version SEC("version") = LINUX_VERSION_CODE;
33 static int (*probe_read)(void *dst, int size, const void *unsafe_addr) = (void *)BPF_FUNC_probe_read;
34 static int (*probe_read_str)(void *dst, int size, const void *unsafe_addr) = (void *)BPF_FUNC_probe_read_str;
36 #endif /* _PERF_BPF_H */