5 #ifndef LINUX_VERSION_CODE 6 # error Need LINUX_VERSION_CODE 7 # error Example: for 4.2 kernel, put 'clang-opt="-DLINUX_VERSION_CODE=0x40200" into llvm section of ~/.perfconfig' 10 #define BPF_MAP_TYPE_ARRAY 2 11 #define BPF_FUNC_map_lookup_elem 1 12 #define BPF_FUNC_map_update_elem 2 14 static void *(*bpf_map_lookup_elem)(
void *
map,
void *
key) =
26 #define SEC(NAME) __attribute__((section(NAME), used)) 29 .key_size =
sizeof(int),
49 char _license[]
SEC(
"license") =
"GPL";
50 int _version
SEC(
"version") = LINUX_VERSION_CODE;
int bpf_func__sys_write(void *ctx)
static void *(* bpf_map_update_elem)(void *map, void *key, void *value, int flags)
#define BPF_FUNC_map_lookup_elem
#define BPF_FUNC_map_update_elem
#define BPF_MAP_TYPE_ARRAY