tools/testing/selftests/bpf/progs/linked_list.h

Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/linked_list.h

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/bpf/progs/linked_list.h
Extension
.h
Size
1166 bytes
Lines
57
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct bar {
	struct bpf_list_node node;
	int data;
};

struct foo {
	struct bpf_list_node node;
	struct bpf_list_head head __contains(bar, node);
	struct bpf_spin_lock lock;
	int data;
	struct bpf_list_node node2;
};

struct map_value {
	struct bpf_spin_lock lock;
	int data;
	struct bpf_list_head head __contains(foo, node2);
};

struct array_map {
	__uint(type, BPF_MAP_TYPE_ARRAY);
	__type(key, int);
	__type(value, struct map_value);
	__uint(max_entries, 1);
};

struct array_map array_map SEC(".maps");
struct array_map inner_map SEC(".maps");

struct {
	__uint(type, BPF_MAP_TYPE_ARRAY_OF_MAPS);
	__uint(max_entries, 1);
	__type(key, int);
	__type(value, int);
	__array(values, struct array_map);
} map_of_maps SEC(".maps") = {
	.values = {
		[0] = &inner_map,
	},
};

#define private(name) SEC(".bss." #name) __hidden __attribute__((aligned(8)))

private(A) struct bpf_spin_lock glock;
private(A) struct bpf_list_head ghead __contains(foo, node2);
private(B) struct bpf_spin_lock glock2;

#endif

Annotation

Implementation Notes