tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c- Extension
.c- Size
- 52633 bytes
- Lines
- 2074
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bpf.hlinux/btf.hlinux/btf_ids.hlinux/delay.hlinux/error-injection.hlinux/init.hlinux/module.hlinux/percpu-defs.hlinux/sysfs.hlinux/tracepoint.hlinux/net.hlinux/socket.hlinux/nsproxy.hlinux/inet.hlinux/in.hlinux/in6.hlinux/un.hlinux/filter.hlinux/rcupdate_trace.hnet/sock.hlinux/namei.hbpf_testmod.hbpf_testmod_kfunc.hbpf_testmod-events.h
Detected Declarations
struct bpf_testmod_struct_arg_1struct bpf_testmod_struct_arg_2struct bpf_testmod_struct_arg_3struct bpf_testmod_struct_arg_4struct bpf_testmod_struct_arg_5struct bpf_testmod_btf_type_tag_1struct bpf_testmod_btf_type_tag_2struct bpf_testmod_btf_type_tag_3struct testmod_uprobestruct bpf_kfunc_rcu_tasks_trace_datafunction bpf_testmod_test_struct_arg_1function bpf_testmod_test_struct_arg_2function bpf_testmod_test_struct_arg_3function bpf_testmod_test_struct_arg_4function bpf_testmod_test_struct_arg_5function bpf_testmod_test_struct_arg_6function bpf_testmod_test_struct_arg_7function bpf_testmod_test_struct_arg_8function bpf_testmod_test_struct_arg_9function bpf_testmod_test_union_arg_1function bpf_testmod_test_union_arg_2function bpf_testmod_test_arg_ptr_to_structfunction bpf_testmod_looooooooooooooooooooooooooooooong_namefunction bpf_iter_testmod_seq_newfunction bpf_iter_testmod_seq_valuefunction bpf_iter_testmod_seq_destroyfunction bpf_kfunc_common_testfunction bpf_kfunc_nested_release_testfunction bpf_kfunc_put_default_trusted_ptr_testfunction testmod_free_cbfunction bpf_testmod_ctx_releasefunction bpf_testmod_ctx_release_dtorfunction bpf_testmod_test_3function bpf_testmod_test_4function bpf_testmod_test_struct_ops3function bpf_testmod_ops3_call_test_1function bpf_testmod_ops3_call_test_2function bpf_testmod_test_btf_type_tag_user_1function bpf_testmod_test_btf_type_tag_user_2function bpf_testmod_test_btf_type_tag_percpu_1function bpf_testmod_test_btf_type_tag_percpu_2function bpf_testmod_loop_testfunction bpf_testmod_fentry_test1function bpf_testmod_fentry_test2function bpf_testmod_fentry_test3function bpf_testmod_fentry_test7function bpf_testmod_fentry_test11function bpf_testmod_stacktrace_test
Annotated Snippet
module_init(bpf_testmod_init);
module_exit(bpf_testmod_exit);
MODULE_AUTHOR("Andrii Nakryiko");
MODULE_DESCRIPTION("BPF selftests module");
MODULE_LICENSE("Dual BSD/GPL");
Annotation
- Immediate include surface: `linux/bpf.h`, `linux/btf.h`, `linux/btf_ids.h`, `linux/delay.h`, `linux/error-injection.h`, `linux/init.h`, `linux/module.h`, `linux/percpu-defs.h`.
- Detected declarations: `struct bpf_testmod_struct_arg_1`, `struct bpf_testmod_struct_arg_2`, `struct bpf_testmod_struct_arg_3`, `struct bpf_testmod_struct_arg_4`, `struct bpf_testmod_struct_arg_5`, `struct bpf_testmod_btf_type_tag_1`, `struct bpf_testmod_btf_type_tag_2`, `struct bpf_testmod_btf_type_tag_3`, `struct testmod_uprobe`, `struct bpf_kfunc_rcu_tasks_trace_data`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.