tools/bpf/bpftool/Documentation/bpftool-gen.rst
Source file repositories/reference/linux-study-clean/tools/bpf/bpftool/Documentation/bpftool-gen.rst
File Facts
- System
- Linux kernel
- Corpus path
tools/bpf/bpftool/Documentation/bpftool-gen.rst- Extension
.rst- Size
- 16362 bytes
- Lines
- 482
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
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
stdbool.hlinux/ptrace.hlinux/bpf.hbpf/bpf_helpers.hbpf_testmod.hstdlib.hbpf/libbpf.hexample.skel.h
Detected Declarations
struct examplestruct example__testmod_map__bpf_testmod_opsstruct example__bssstruct example__datastruct example__rodatafunction SECfunction SECfunction SECfunction main
Annotated Snippet
struct example {
struct bpf_object_skeleton *skeleton;
struct bpf_object *obj;
struct {
struct bpf_map *rodata;
struct bpf_map *data;
struct bpf_map *bss;
struct bpf_map *my_map;
struct bpf_map *testmod_map;
} maps;
struct {
struct example__testmod_map__bpf_testmod_ops {
const struct bpf_program *test_1;
const struct bpf_program *test_2;
int data;
} *testmod_map;
} struct_ops;
struct {
struct bpf_program *handle_sys_enter;
struct bpf_program *handle_sys_exit;
} progs;
struct {
struct bpf_link *handle_sys_enter;
struct bpf_link *handle_sys_exit;
} links;
struct example__bss {
struct {
int x;
} data;
int test_2_result;
} *bss;
struct example__data {
_Bool global_flag;
long int handle_sys_enter_my_static_var;
} *data;
struct example__rodata {
int param1;
} *rodata;
};
static void example__destroy(struct example *obj);
static inline struct example *example__open_opts(
const struct bpf_object_open_opts *opts);
static inline struct example *example__open();
static inline int example__load(struct example *obj);
static inline struct example *example__open_and_load();
static inline int example__attach(struct example *obj);
static inline void example__detach(struct example *obj);
#endif /* __EXAMPLE_SKEL_H__ */
**$ cat example.c**
::
#include "example.skel.h"
int main()
{
struct example *skel;
int err = 0;
skel = example__open();
if (!skel)
goto cleanup;
skel->rodata->param1 = 128;
/* Change the value through the pointer of shadow type */
skel->struct_ops.testmod_map->data = 13;
Annotation
- Immediate include surface: `stdbool.h`, `linux/ptrace.h`, `linux/bpf.h`, `bpf/bpf_helpers.h`, `bpf_testmod.h`, `stdlib.h`, `bpf/libbpf.h`, `example.skel.h`.
- Detected declarations: `struct example`, `struct example__testmod_map__bpf_testmod_ops`, `struct example__bss`, `struct example__data`, `struct example__rodata`, `function SEC`, `function SEC`, `function SEC`, `function main`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
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.