...

Text file src/github.com/cilium/ebpf/testdata/map_spin_lock.c

Documentation: github.com/cilium/ebpf/testdata

     1/* This file excercises bpf_spin_lock. */
     2
     3#include "common.h"
     4
     5struct bpf_spin_lock {
     6	uint32_t val;
     7};
     8
     9struct hash_elem {
    10	int cnt;
    11	struct bpf_spin_lock lock;
    12};
    13
    14#if __clang_major__ >= 9
    15struct {
    16	__uint(type, BPF_MAP_TYPE_HASH);
    17	__type(key, uint32_t);
    18	__type(value, struct hash_elem);
    19	__uint(max_entries, 2);
    20} spin_lock_map __section(".maps");
    21#else
    22#error This file required clang >= 9
    23#endif

View as plain text