Lines Matching +full:en +full:- +full:global
1 .. SPDX-License-Identifier: GPL-2.0
7 libbpf is a C-based library containing a BPF loader that takes compiled BPF
13 The following are the high-level features supported by libbpf:
15 * Provides high-level and low-level APIs for user space programs to interact
16 with BPF programs. The low-level APIs wrap all the bpf system call
17 functionality, which is useful when users need more fine-grained control
21 global variables and work with BPF programs.
22 * Provides BPF-side APIS, including BPF helper definitions, BPF maps support,
24 * Supports BPF CO-RE mechanism, enabling BPF developers to write portable
36 completely independent), BPF maps, and global variables. The global
46 object file and discovers BPF maps, BPF programs, and global variables. After
48 (setting BPF program types, if necessary; pre-setting initial values for
49 global variables, etc.) before all the entities are created and loaded.
62 packets, or updating BPF maps and global variables that can be read from user
87 * ``<name>__attach()`` – attaches all auto-attachable BPF programs (it’s
99 ---------------------------------------
102 global variables. The skeleton code memory maps global variables as a struct
110 string-based lookups with ``bpf_object_find_map_by_name()`` and
112 code and user-space code getting out of sync.
120 libbpf provides BPF-side APIs that BPF programs can use to interact with the
127 the return value, see the `bpf-helpers
128 <https://man7.org/linux/man-pages/man7/bpf-helpers.7.html>`_ man page.
130 BPF CO-RE (Compile Once – Run Everywhere)
140 libbpf steps up the BPF program portability by supporting the BPF CO-RE concept.
141 BPF CO-RE brings together BTF type information, libbpf, and the compiler to
146 running kernel. Kernel also exposes this self-describing authoritative BTF
158 ``vmlinux.h`` in your BPF program eliminates dependency on system-wide kernel
166 specific kernel on the host. BPF CO-RE concept thus eliminates overhead
172 ``task_struct`` using BPF CO-RE and libbf. The basic helper to read a field in a
173 CO-RE relocatable manner is ``bpf_core_read(dst, sz, src)``, which will read
177 .. code-block:: C
178 :emphasize-lines: 6
185 err = bpf_core_read(&parent_task, sizeof(void *), &task->parent);
190 /* parent_task contains the value of task->parent pointer */
204 Check out the `libbpf-bootstrap <https://github.com/libbpf/libbpf-bootstrap>`_
209 <https://libbpf.readthedocs.io/en/latest/api.html>`_.
215 `Libbpf-rs <https://github.com/libbpf/libbpf-rs>`_ library instead of bindgen
216 bindings directly to libbpf. Libbpf-rs wraps libbpf functionality in
217 Rust-idiomatic interfaces and provides libbpf-cargo plugin to handle BPF code
218 compilation and skeleton generation. Using Libbpf-rs will make building user
225 * `Program types and ELF Sections <https://libbpf.readthedocs.io/en/latest/program_types.html>`_
226 * `API naming convention <https://libbpf.readthedocs.io/en/latest/libbpf_naming_convention.html>`_
227 * `Building libbpf <https://libbpf.readthedocs.io/en/latest/libbpf_build.html>`_
228 …tion Convention <https://libbpf.readthedocs.io/en/latest/libbpf_naming_convention.html#api-documen…