Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1// SPDX-License-Identifier: GPL-2.0
2
3#include "vmlinux.h"
4#include <bpf/bpf_helpers.h>
5
6char _license[] SEC("license") = "GPL";
7
8struct timer_val {
9 struct bpf_timer timer;
10};
11
12struct {
13 __uint(type, BPF_MAP_TYPE_HASH);
14 __type(key, __u32);
15 __type(value, struct timer_val);
16 __uint(max_entries, 1);
17} timer_prealloc SEC(".maps");
18
19struct {
20 __uint(type, BPF_MAP_TYPE_HASH);
21 __type(key, __u32);
22 __type(value, struct timer_val);
23 __uint(max_entries, 1);
24 __uint(map_flags, BPF_F_NO_PREALLOC);
25} timer_no_prealloc SEC(".maps");