tools/testing/selftests/bpf/progs/struct_ops_detach.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/struct_ops_detach.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/progs/struct_ops_detach.c- Extension
.c- Size
- 684 bytes
- Lines
- 23
- 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.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
vmlinux.hbpf/bpf_helpers.h../test_kmods/bpf_testmod.h
Detected Declarations
function program
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
#include <vmlinux.h>
#include <bpf/bpf_helpers.h>
#include "../test_kmods/bpf_testmod.h"
char _license[] SEC("license") = "GPL";
/*
* This subprogram validates that libbpf handles the situation in which BPF
* object has subprograms in .text section, but has no entry BPF programs.
* At some point that was causing issues due to legacy logic of treating such
* subprogram as entry program (with unknown program type, which would fail).
*/
int dangling_subprog(void)
{
/* do nothing, just be here */
return 0;
}
SEC(".struct_ops.link")
struct bpf_testmod_ops testmod_do_detach;
Annotation
- Immediate include surface: `vmlinux.h`, `bpf/bpf_helpers.h`, `../test_kmods/bpf_testmod.h`.
- Detected declarations: `function program`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.