Lines Matching +full:helper +full:- +full:simple +full:- +full:access
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
20 The skeleton file simplifies the process for the user space programs to access
22 * Provides BPF-side APIS, including BPF helper definitions, BPF maps support,
24 * Supports BPF CO-RE mechanism, enabling BPF developers to write portable
48 (setting BPF program types, if necessary; pre-setting initial values for
87 * ``<name>__attach()`` – attaches all auto-attachable BPF programs (it’s
93 in mind, BPF skeleton provides access to the underlying BPF object, so whatever
99 ---------------------------------------
108 available maps, programs, etc. BPF skeleton provides direct access to all the
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
122 any other plain C function. For example, there are helper functions to print
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)
133 BPF programs work in the kernel space and have access to kernel memory and data
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 */
195 just like ``bpf_probe_read_kernel()`` BPF helper, except it records information
204 Check out the `libbpf-bootstrap <https://github.com/libbpf/libbpf-bootstrap>`_
205 repository with simple examples of using libbpf to build various BPF
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
228 …tps://libbpf.readthedocs.io/en/latest/libbpf_naming_convention.html#api-documentation-convention>`_