Skip to content

Libbpf userspace

Definitions for the libbpf userspace library are split across a few different header files.

High level APIs

In the libbpf.h header file you will find the high level APIs which do a lot of work for you under the hood. These are the most commonly used APIs.

BTF APIs

In the btf.h header file you will find the BTF APIs, to do more advanced BTF operations other than just loading BTF from an object file.

Low level APIs

In the bpf.h header file you will find the low level APIs which are used to interact with the kernel. These are basically just wrappers around the bpf() syscall. You should only use these if you know what you are doing and can't do something with the high level APIs.

Deprecated APIs

In the libbpf_legacy.h header file you will find the deprecated APIs. These are APIs that are no longer recommended to use and might be removed in the future.