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

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

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/bpf/progs/nested_acquire.c
Extension
.c
Size
745 bytes
Lines
34
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

// SPDX-License-Identifier: GPL-2.0

#include <vmlinux.h>
#include <bpf/bpf_tracing.h>
#include <bpf/bpf_helpers.h>
#include "bpf_misc.h"
#include "../test_kmods/bpf_testmod_kfunc.h"

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

SEC("tp_btf/tcp_probe")
__success
int BPF_PROG(test_nested_acquire_nonzero, struct sock *sk, struct sk_buff *skb)
{
	struct sk_buff *ptr;

	ptr = bpf_kfunc_nested_acquire_nonzero_offset_test(&sk->sk_write_queue);

	bpf_kfunc_nested_release_test(ptr);
	return 0;
}

SEC("tp_btf/tcp_probe")
__success
int BPF_PROG(test_nested_acquire_zero, struct sock *sk, struct sk_buff *skb)
{
	struct sk_buff *ptr;

	ptr = bpf_kfunc_nested_acquire_zero_offset_test(&sk->__sk_common);

	bpf_kfunc_nested_release_test(ptr);
	return 0;
}

Annotation

Implementation Notes