tools/lib/bpf/features.c
Source file repositories/reference/linux-study-clean/tools/lib/bpf/features.c
File Facts
- System
- Linux kernel
- Corpus path
tools/lib/bpf/features.c- Extension
.c- Size
- 20629 bytes
- Lines
- 736
- 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
linux/kernel.hlinux/filter.hbpf.hlibbpf.hlibbpf_common.hlibbpf_internal.h
Detected Declarations
function ptr_to_u64function probe_fdfunction probe_kern_prog_namefunction probe_kern_global_datafunction probe_kern_btffunction probe_kern_btf_funcfunction probe_kern_btf_func_globalfunction probe_kern_btf_datasecfunction probe_kern_btf_qmark_datasecfunction probe_kern_btf_floatfunction probe_kern_btf_decl_tagfunction probe_kern_btf_type_tagfunction probe_kern_array_mmapfunction probe_kern_exp_attach_typefunction probe_kern_probe_read_kernelfunction probe_prog_bind_mapfunction probe_module_btffunction probe_perf_linkfunction probe_uprobe_multi_linkfunction probe_kern_bpf_cookiefunction probe_kern_btf_enum64function probe_kern_arg_ctx_tagfunction probe_ldimm64_full_range_offfunction probe_uprobe_syscallfunction probe_uprobe_syscallfunction probe_kern_btf_layoutfunction probe_bpf_syscall_common_attrsfunction feat_supported
Annotated Snippet
if (ret > 0) {
WRITE_ONCE(cache->res[feat_id], FEAT_SUPPORTED);
} else if (ret == 0) {
WRITE_ONCE(cache->res[feat_id], FEAT_MISSING);
} else {
pr_warn("Detection of kernel %s support failed: %s\n",
feat->desc, errstr(ret));
WRITE_ONCE(cache->res[feat_id], FEAT_MISSING);
}
}
return READ_ONCE(cache->res[feat_id]) == FEAT_SUPPORTED;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/filter.h`, `bpf.h`, `libbpf.h`, `libbpf_common.h`, `libbpf_internal.h`.
- Detected declarations: `function ptr_to_u64`, `function probe_fd`, `function probe_kern_prog_name`, `function probe_kern_global_data`, `function probe_kern_btf`, `function probe_kern_btf_func`, `function probe_kern_btf_func_global`, `function probe_kern_btf_datasec`, `function probe_kern_btf_qmark_datasec`, `function probe_kern_btf_float`.
- 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.