1 // SPDX-License-Identifier: GPL-2.0
4 #include <bpf/bpf_helpers.h>
6 char _license[] SEC("license") = "GPL";
9 __uint(type, BPF_MAP_TYPE_HASH);
10 __uint(max_entries, 2);
11 __type(key, struct bigelement);
13 } hash_map SEC(".maps");
16 __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
17 __uint(max_entries, 1);
19 __type(value, struct bigelement);
20 } key_map SEC(".maps");
28 SEC("raw_tracepoint/sys_enter")
29 int bpf_hash_large_key_test(void *ctx)
31 int zero = 0, value = 42;
32 struct bigelement *key;
34 key = bpf_map_lookup_elem(&key_map, &zero);
39 if (bpf_map_update_elem(&hash_map, key, &value, BPF_ANY))