tools/testing/selftests/bpf/flow_dissector_load.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/flow_dissector_load.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/flow_dissector_load.c- Extension
.c- Size
- 2349 bytes
- Lines
- 112
- 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
error.herrno.hgetopt.hstdio.hstdlib.hstring.hsys/stat.hfcntl.hunistd.hbpf/bpf.hbpf/libbpf.hflow_dissector_load.h
Detected Declarations
function load_and_attach_programfunction detach_programfunction parse_optsfunction main
Annotated Snippet
switch (c) {
case 'a':
if (detach)
error(1, 0, "attach/detach are exclusive");
attach = true;
break;
case 'd':
if (attach)
error(1, 0, "attach/detach are exclusive");
detach = true;
break;
case 'p':
if (cfg_path_name)
error(1, 0, "only one path can be given");
cfg_path_name = optarg;
break;
case 's':
if (cfg_prog_name)
error(1, 0, "only one prog can be given");
cfg_prog_name = optarg;
break;
}
}
if (detach)
cfg_attach = false;
if (cfg_attach && !cfg_path_name)
error(1, 0, "must provide a path to the BPF program");
if (cfg_attach && !cfg_prog_name)
error(1, 0, "must provide a section name");
}
int main(int argc, char **argv)
{
parse_opts(argc, argv);
if (cfg_attach)
load_and_attach_program();
else
detach_program();
return 0;
}
Annotation
- Immediate include surface: `error.h`, `errno.h`, `getopt.h`, `stdio.h`, `stdlib.h`, `string.h`, `sys/stat.h`, `fcntl.h`.
- Detected declarations: `function load_and_attach_program`, `function detach_program`, `function parse_opts`, `function main`.
- 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.