summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/test_pinning_htab.c
blob: ae227930c73cef1894a9e928ec396aa0a9b6ec4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// SPDX-License-Identifier: GPL-2.0

#include "vmlinux.h"
#include <bpf/bpf_helpers.h>

char _license[] SEC("license") = "GPL";

struct timer_val {
	struct bpf_timer timer;
};

struct {
	__uint(type, BPF_MAP_TYPE_HASH);
	__type(key, __u32);
	__type(value, struct timer_val);
	__uint(max_entries, 1);
} timer_prealloc SEC(".maps");

struct {
	__uint(type, BPF_MAP_TYPE_HASH);
	__type(key, __u32);
	__type(value, struct timer_val);
	__uint(max_entries, 1);
	__uint(map_flags, BPF_F_NO_PREALLOC);
} timer_no_prealloc SEC(".maps");