Lines Matching +full:pre +full:- +full:verified

1 .. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
4 bpftool-gen
6 -------------------------------------------------------------------------------
7 tool for BPF code-generation
8 -------------------------------------------------------------------------------
19 *OPTIONS* := { |COMMON_OPTIONS| | { **-L** | **--use-loader** } }
38 The rules of BPF static linking are mostly the same as for user-space
68 user in pre-allocated fields in skeleton struct. For BPF programs that
70 but store resulting BPF link in per-program link field. All such set up
76 variables of all supported kinds: mutable, read-only, as well as extern
77 ones. This interface allows to pre-setup initial values of variables before
78 BPF object is loaded and verified by kernel. For non-read-only variables,
84 This ensures skeleton and BPF object file are matching 1-to-1 and always
85 stay in sync. Generated code is dual-licensed under LGPL-2.1 and
86 BSD-2-Clause licenses.
100 - **example__open** and **example__open_opts**.
105 - **example__load**.
110 - **example__open_and_load** combines **example__open** and
113 - **example__attach** and **example__detach**.
116 for auto-attachment will be auto-attached and their corresponding BPF
122 - **example__destroy**.
131 if target kernel supports memory-mapped BPF arrays, same structs can be
132 used to fetch and update (non-read-only) data from userspace, with same
149 - **example__open(bpf_object\*)**.
153 - **example__destroy()**.
160 CO-RE relocations may be satisfied.
164 calculate CO-RE relocations.
172 CO-RE based application, turning the application portable to different
184 -L, --use-loader
251 * and testmod_map->data.
269 **$ clang --target=bpf -g example1.bpf.c -o example1.bpf.o**
271 **$ clang --target=bpf -g example2.bpf.c -o example2.bpf.o**
273 **$ clang --target=bpf -g example3.bpf.c -o example3.bpf.o**
285 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
360 skel->rodata->param1 = 128;
363 skel->struct_ops.testmod_map->data = 13;
370 printf("test_2_result: %d\n", skel->bss->test_2_result);
377 printf("my_map name: %s\n", bpf_map__name(skel->maps.my_map));
379 bpf_program__fd(skel->progs.handle_sys_enter));
381 /* detach and re-attach sys_exit program */
382 bpf_link__destroy(skel->links.handle_sys_exit);
383 skel->links.handle_sys_exit =
384 bpf_program__attach(skel->progs.handle_sys_exit);
387 skel->bss->handle_sys_enter_my_static_var);
403 This is a stripped-out version of skeleton generated for above example code.
406 ------------
408 **$ bpftool btf dump file 5.4.0-example.btf format raw**
439 **$ bpftool gen min_core_btf 5.4.0-example.btf 5.4.0-smaller.btf one.bpf.o**
441 **$ bpftool btf dump file 5.4.0-smaller.btf format raw**
458 Now, the "5.4.0-smaller.btf" file may be used by libbpf as an external BTF file
459 when loading the "one.bpf.o" object into the "5.4.0-example" kernel. Note that
465 LIBBPF_OPTS(bpf_object_open_opts, opts, .btf_custom_path = "5.4.0-smaller.btf");