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** }] | { **-d** | **--debug** } |
16 { **-L** | **--use-loader** } }
20 GEN COMMANDS
23 | **bpftool** **gen object** *OUTPUT_FILE* *INPUT_FILE* [*INPUT_FILE*...]
24 | **bpftool** **gen skeleton** *FILE* [**name** *OBJECT_NAME*]
25 | **bpftool** **gen help**
29 **bpftool gen object** *OUTPUT_FILE* *INPUT_FILE* [*INPUT_FILE*...]
35 user-space object files, but in addition to combining data
45 generated BPF skeleton (with **gen skeleton** command) or
49 **bpftool gen skeleton** *FILE*
69 user in pre-allocated fields in skeleton struct. For BPF
72 in per-program link field. All such set up links will be
79 global variables of all supported kinds: mutable, read-only,
80 as well as extern ones. This interface allows to pre-setup
82 verified by kernel. For non-read-only variables, the same
89 object file are matching 1-to-1 and always stay in sync.
90 Generated code is dual-licensed under LGPL-2.1 and
91 BSD-2-Clause licenses.
108 - **example__open** and **example__open_opts**.
114 - **example__load**.
119 - **example__open_and_load** combines **example__open** and
123 - **example__attach** and **example__detach**
126 programs of types supported by libbpf for auto-attachment
127 will be auto-attached and their corresponding BPF links
134 - **example__destroy**
144 Afterwards, if target kernel supports memory-mapped BPF
146 (non-read-only) data from userspace, with same simplicity
149 **bpftool gen help**
156 -L, --use-loader
214 **$ clang -target bpf -g example1.bpf.c -o example1.bpf.o**
215 **$ clang -target bpf -g example2.bpf.c -o example2.bpf.o**
216 **$ bpftool gen object example.bpf.o example1.bpf.o example2.bpf.o**
222 **$ bpftool gen skeleton example.bpf.o name example | tee example.skel.h**
226 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
292 skel->rodata->param1 = 128;
303 printf("my_map name: %s\n", bpf_map__name(skel->maps.my_map));
305 bpf_program__fd(skel->progs.handle_sys_enter));
307 /* detach and re-attach sys_exit program */
308 bpf_link__destroy(skel->links.handle_sys_exit);
309 skel->links.handle_sys_exit =
310 bpf_program__attach(skel->progs.handle_sys_exit);
313 skel->bss->handle_sys_enter_my_static_var);
328 This is a stripped-out version of skeleton generated for above example code.