tools/testing/selftests/bpf/progs/fexit_bpf2bpf_simple.c

Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/fexit_bpf2bpf_simple.c

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/bpf/progs/fexit_bpf2bpf_simple.c
Extension
.c
Size
488 bytes
Lines
28
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 sk_buff {
	unsigned int len;
};

__u64 test_result = 0;

SEC("fexit/test_pkt_md_access")
int BPF_PROG(test_main2, struct sk_buff *skb, int ret)
{
	int len;

	__builtin_preserve_access_index(({
		len = skb->len;
	}));
	if (len != 74 || ret != 0)
		return 0;

	test_result = 1;
	return 0;
}
char _license[] SEC("license") = "GPL";

Annotation

Implementation Notes