Syncing latest libbpf commits from kernel repository.
Baseline bpf-next commit: 679152d3a32e305c213f83160c328c37566ae8bc
Checkpoint bpf-next commit: 7745ff9842617323adbe24e71c495d5ebd9aa352
Baseline bpf commit: fe3300897cbfd76c6cb825776e5ac0ca50a91ca4
Checkpoint bpf commit: 1148f9adbe71415836a18a36c1b4ece999ab0973
Andrii Nakryiko (26):
libbpf: Extract and generalize CPU mask parsing logic
libbpf: Don't attach perf_buffer to offline/missing CPUs
libbpf: Don't require root for bpf_object__open()
libbpf: Add generic bpf_program__attach()
libbpf: Move non-public APIs from libbpf.h to libbpf_internal.h
libbpf: Add BPF_EMBED_OBJ macro for embedding BPF .o files
libbpf: Extract common user-facing helpers
libbpf: Expose btf__align_of() API
libbpf: Expose BTF-to-C type declaration emitting API
libbpf: Expose BPF program's function name
libbpf: Refactor global data map initialization
libbpf: Postpone BTF ID finding for TRACING programs to load phase
libbpf: Reduce log level of supported section names dump
libbpf: Add BPF object skeleton support
libbpf: Extract internal map names into constants
libbpf: Support libbpf-provided extern variables
bpftool: Generate externs datasec in BPF skeleton
libbpf: Support flexible arrays in CO-RE
libbpf: Add zlib as a dependency in pkg-config template
libbpf: Reduce log level for custom section names
libbpf: Remove BPF_EMBED_OBJ macro from libbpf.h
libbpf: Add bpf_link__disconnect() API to preserve underlying BPF
resource
libbpf: Put Kconfig externs into .kconfig section
libbpf: Allow to augment system Kconfig through extra optional config
libbpf: BTF is required when externs are present
libbpf: Fix another __u64 printf warning
Jakub Sitnicki (1):
libbpf: Recognize SK_REUSEPORT programs from section name
Prashant Bhole (1):
libbpf: Fix build by renaming variables
Toke Høiland-Jørgensen (4):
libbpf: Print hint about ulimit when getting permission denied error
libbpf: Fix libbpf_common.h when installing libbpf through 'make
install'
libbpf: Add missing newline in opts validation macro
libbpf: Fix printing of ulimit value
include/uapi/linux/btf.h | 7 +-
src/bpf.h | 6 +-
src/bpf_helpers.h | 11 +
src/btf.c | 48 +-
src/btf.h | 29 +-
src/btf_dump.c | 115 ++-
src/libbpf.c | 1673 ++++++++++++++++++++++++++++++++------
src/libbpf.h | 107 +--
src/libbpf.map | 12 +
src/libbpf.pc.template | 2 +-
src/libbpf_common.h | 40 +
src/libbpf_internal.h | 21 +-
12 files changed, 1678 insertions(+), 393 deletions(-)
create mode 100644 src/libbpf_common.h
--
2.17.1
This is a mirror of bpf-next linux tree's
tools/lib/bpf directory plus its supporting header files.
The following files will by sync'ed with bpf-next repo:
src/<->bpf-next/tools/lib/bpf/include/uapi/linux/bpf_common.h<->bpf-next/tools/include/uapi/linux/bpf_common.hinclude/uapi/linux/bpf.h<->bpf-next/tools/include/uapi/linux/bpf.hinclude/uapi/linux/btf.h<->bpf-next/tools/include/uapi/linux/btf.hinclude/uapi/linux/if_link.h<->bpf-next/tools/include/uapi/linux/if_link.hinclude/uapi/linux/if_xdp.h<->bpf-next/tools/include/uapi/linux/if_xdp.hinclude/uapi/linux/netlink.h<->bpf-next/tools/include/uapi/linux/netlink.hinclude/tools/libc_compat.h<->bpf-next/tools/include/tools/libc_compat.h
Other header files at this repo (include/linux/*.h) are reduced versions of
their counterpart files at bpf-next's tools/include/linux/*.h to make compilation
successful.
Build

libelf is an internal dependency of libbpf and thus it is required to link
against and must be installed on the system for applications to work.
pkg-config is used by default to find libelf, and the program called can be
overridden with PKG_CONFIG.
If using pkg-config at build time is not desired, it can be disabled by setting
NO_PKG_CONFIG=1 when calling make.
To build both static libbpf.a and shared libbpf.so:
$ cd src
$ make
To build only static libbpf.a library in directory build/ and install them together with libbpf headers in a staging directory root/:
$ cd src
$ mkdir build root
$ BUILD_STATIC_ONLY=y OBJDIR=build DESTDIR=root make install
To build both static libbpf.a and shared libbpf.so against a custom libelf dependency installed in /build/root/ and install them together with libbpf headers in a build directory /build/root/:
$ cd src
$ PKG_CONFIG_PATH=/build/root/lib64/pkgconfig DESTDIR=/build/root make install
License
This work is dual-licensed under BSD 2-clause license and GNU LGPL v2.1 license. You can choose between one of them if you use this work.
SPDX-License-Identifier: BSD-2-Clause OR LGPL-2.1