File: map_spin_lock.c

package info (click to toggle)
golang-github-cilium-ebpf 0.17.3%2Bds1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,688 kB
  • sloc: ansic: 1,259; makefile: 127; python: 113; awk: 29; sh: 24
file content (19 lines) | stat: -rw-r--r-- 329 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* This file excercises bpf_spin_lock. */

#include "common.h"

struct bpf_spin_lock {
	uint32_t val;
};

struct hash_elem {
	int cnt;
	struct bpf_spin_lock lock;
};

struct {
	__uint(type, BPF_MAP_TYPE_HASH);
	__type(key, uint32_t);
	__type(value, struct hash_elem);
	__uint(max_entries, 2);
} spin_lock_map __section(".maps");