Lines Matching +full:gen +full:- +full:2
2 bpftool-gen
4 -------------------------------------------------------------------------------
5 tool for BPF code-generation
6 -------------------------------------------------------------------------------
13 **bpftool** [*OPTIONS*] **gen** *COMMAND*
15 *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] }
19 GEN COMMANDS
22 | **bpftool** **gen skeleton** *FILE*
23 | **bpftool** **gen help**
27 **bpftool gen skeleton** *FILE*
47 user in pre-allocated fields in skeleton struct. For BPF
50 in per-program link field. All such set up links will be
57 global variables of all supported kinds: mutable, read-only,
58 as well as extern ones. This interface allows to pre-setup
60 verified by kernel. For non-read-only variables, the same
67 object file are matching 1-to-1 and always stay in sync.
68 Generated code is dual-licensed under LGPL-2.1 and
69 BSD-2-Clause licenses.
83 - **example__open** and **example__open_opts**.
89 - **example__load**.
94 - **example__open_and_load** combines **example__open** and
98 - **example__attach** and **example__detach**
101 programs of types supported by libbpf for auto-attachment
102 will be auto-attached and their corresponding BPF links
109 - **example__destroy**
119 Afterwards, if target kernel supports memory-mapped BPF
121 (non-read-only) data from userspace, with same simplicity
124 **bpftool gen help**
175 **$ bpftool gen skeleton example.o**
179 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
245 skel->rodata->param1 = 128;
256 printf("my_map name: %s\n", bpf_map__name(skel->maps.my_map));
258 bpf_program__fd(skel->progs.handle_sys_enter));
260 /* detach and re-attach sys_exit program */
261 bpf_link__destroy(skel->links.handle_sys_exit);
262 skel->links.handle_sys_exit =
263 bpf_program__attach(skel->progs.handle_sys_exit);
266 skel->bss->handle_sys_enter_my_static_var);
281 This is a stripped-out version of skeleton generated for above example code.