Automated upstream mirror for libbpf stand-alone build.
Single fix (https://github.com/libbpf/libbpf/pull/795) on top of v0.8.1, fixing the name of bpf_program__pin_instance()
API call,
previously erroneously specified as bpf_object__pin_instance()
in the code.
Note that we skip v0.8.2, as its Github release tagging was broken.
Note, this API is gone in v1.0+.
Full Changelog: https://github.com/libbpf/libbpf/compare/v0.8.1...v0.8.3
UPDATE: this v0.8.2 release is screwed up and point to latest v1.4.0, please don't use it, v0.8.3 is the right now to package/use. Sorry for the confusion and wasted time!
Single fix (https://github.com/libbpf/libbpf/pull/795) on top of v0.8.1, fixing the name of bpf_program__pin_instance()
API call,
previously erroneously specified as bpf_object__pin_instance()
in the code.
Note, this API is gone in v1.0+.
LIBBPF_BPF_TOKEN_PATH
envvar);___smth
) for struct_ops types, allowing to define two incompatible definitions for the same target struct_ops kernel type;SEC("?.struct_ops")
and SEC("?.struct_ops.link")
are now supported, default to not auto-create struct_ops map;bpf_map__set_autocreate()
is now honored for struct_ops maps;struct bpf_program
or struct bpf_map
instances there were not loaded or created, respectively;SEC("sk_skb/verdict")
support;__arg_ctx
, __arg_nonnull
, __arg_nullable
, __arg_trusted
, and __arg_arena
annotations added;__arg_ctx
work on older kernels that don't yet support __arg_ctx
(i.e., arg:ctx
decl tag) annotation natively;bpf_core_cast()
macro added, improving ergonomics of bpf_rdonly_cast()
BPF helper;__arena
tagged global variables, which are automatically put into BPF arena map;__long()
macro added for specifying 64-bit values when declaring BTF-defined maps;bpf_core_read.h
header;faccessat()
internal usage, breaking Android versions of libbpf;OPTS_SET()
in bpf_xdp_query()
for better backward/forward compatibility;max_entries
setting logic;btf_ext__raw_data()
and btf__new_split()
APIs are added back, they were "lost" during libbpf v1.0 release process;Full Changelog: https://github.com/libbpf/libbpf/compare/v1.3.0...v1.4.0
netfilter
programs is added:
SEC("netfilter")
is now availablebpf_program__attach_netfilter()
is now availabletcx
BPF programs is added:
SEC("tc/egress")
SEC("tc/ingress")
SEC("tcx/egress")
SEC("tcx/ingress")
SEC("tc")
SEC("action")
SEC("classifier")
bpf_prog_attach_opts()
and bpf_prog_query_opts()
are extended to work with tcx
programs, plus two new API functions are added:
bpf_prog_detach_opts()
bpf_program__attach_tcx()
SEC("uprobe.multi")
SEC("uprobe.multi.s")
SEC("uretprobe.multi")
SEC("uretprobe.multi.s")
bpf_program__attach_uprobe_multi()
SEC("usdt.s")
is added for sleepable usdt
programs;SEC("cgroup/connect_unix")
SEC("cgroup/sendmsg_unix")
SEC("cgroup/recvmsg_unix")
SEC("cgroup/getpeername_unix")
SEC("cgroup/getsockname_unix")
LIBBPF_OPTS_RESET()
utility macro;bpf_object__unpin()
function to complement existing bpf_object__pin()
;ring_buffer__ring()
ring__producer_pos()
ring__consumer_pos()
ring__avail_data_size()
ring__size()
ring__map_fd()
ring__consume()
path_fd
support for bpf_obj_pin()
and bpf_obj_get()
;bpf_map__set_value_size()
can now be used to resize memory mapped region for memory mapped maps;struct bpf_xdp_query_opts
extended with xdp_zc_max_segs
output field;___.*
suffix is ignored when kfunc relocations are resolved;__percpu_kptr
macro definition in bpf_helpers.h
;__attribute__(btf_decl_tag("exception_callback:<func_name>"))
to specify exception callback for a program;Two bug fixes:
perf
tool caused by libbpf resetting its custom catch-all SEC()
handler on explicit bpf_program__set_type()
call. Given custom SEC()
handlers is a rarely used pretty esoteric feature of libbpf, most users should not be affected.__bpf_usdt_specs
map due to having too many unique USDT specs. Running out of space can be mitigated by bumping up BPF_USDT_MAX_SPEC_CNT
define before including bpf/usdt.bpf.h
header in BPF-side code. This will prevent the double-free as a side effect (and will make it possible to successfully attach all requested USDTs), which is a recommended work-around for libbpf versions prior to v1.2.2.struct_ops
programs:
SEC(".struct_ops.link")
annotations;bpf_map__attach_struct_ops()
attach API;bpf_link__update_map()
link update API;SEC("struct_ops.s")
programs;libbpf_set_print()
;bpf_{btf,link,map,prog}_get_info_by_fd()
APIs;bpf_xdp_query_opts()
supports fetching XDP/XSK supported features;perf_buffer__new()
allows customizing notification/sampling period now;log_true_size
for getting required log buffer size to fit BPF verifier log completely;bpf_for()
, bpf_repeat()
, bpf_for_each()
;bpf_ksym_exists()
macro to check existence of ksyms/kfuncs and kconfig values;BPF_UPROBE()
and BPF_URETPROBE()
macros;BPF_KPROBE()
and BPF_UPROBE()
macros allow fetching up to 8 passed in registers arguments, depending on architecture support;BPF_KSYSCALL()
supports fetching all 6 syscall arguments now;BPF_F_MMAPABLE
flag sanitization;BPF_PROBE_READ{_STR}_INTO()
on s390x architecture;Full Changelog: https://github.com/libbpf/libbpf/compare/v1.1.0...v1.2.0
BPF_MAP_TYPE_USER_RINGBUF
) support;SEC()
definitions;bpf_{link,btf,pro,mapg}_get_fd_by_id_opts()
and bpf_get_fd_by_id_opts()
APIs;BPF_MAP_TYPE_CGRP_STORAGE
);BPF_F_MMAPABLE
flag for data maps with global (i.e., non-static) vars;BPF_PROG2()
macro added that supports struct-by-value arguments;bpf_user_ringbuf_drain()
;cgrp_storage_get()
and cgrp_storage_delete()
.btf__align_of()
determines packed structs better now;SEC("freplace")
programs don't have attach_prog_fd
set;Full Changelog: https://github.com/libbpf/libbpf/compare/v1.0.1...v1.1.0
struct bpf_object_open_opts
memory layout;struct enum64
type defined in kernel UAPI headers;struct btf_map_def
accidentally left in bpf_helpers.h header.Also libbpf will attempt to load vmlinux BTF from well known locations both ELF file (.BTF section) or as raw BTF binary data.
Full Changelog: https://github.com/libbpf/libbpf/compare/v1.0.0...v1.0.1
SEC("ksyscall/<syscall_name>")
and SEC("kretsyscall/<syscall_name>")
);SEC("uprobe.s")
);SEC("lsm_cgroup")
);TYPE_MATCHES
;bpf_prog_load()
and bpf_map_create()
are now smarter about handling program and map name on old kernels (it will be ignored if kernel doesn't support names);BTF_KIND_ENUM64
support;libbpf_bpf_prog_type_str()
;libbpf_bpf_map_type_str()
;libbpf_bpf_link_type_str()
;libbpf_bpf_attach_type_str()
;bpf_program__set_autoattach()
and bpf_program__autoattach()
to allow opting out from auto-attaching of BPF program by BPF skeleton;perf_buffer__buffer()
API to give access to underlying per-CPU buffer for BPF ringbuf;bpf_obj_get_opts()
API for more flexible fetching of BPF kernel objects' information.bpf_core_type_matches()
helper macro to emit TYPE_MATCHES
CO-RE relocations;BPF_KSYSCALL()
macro for tracing syscalls, which abstracts away a lot of kernel- and architecture-specific differences;bpf_skc_to_mptcp_sock()
;bpf_dynptr_from_mem()
;bpf_ringbuf_reserve_dynptr()
, bpf_ringbuf_submit_dynptr()
, bpf_ringbuf_discard_dynptr()
;bpf_dynptr_read()
, bpf_dynptr_write()
;bpf_dynptr_data()
;bpf_tcp_raw_gen_syncookie_ipv4()
, bpf_tcp_raw_gen_syncookie_ipv6()
, bpf_tcp_raw_check_syncookie_ipv4()
, bpf_tcp_raw_check_syncookie_ipv6()
;bpf_ktime_get_tai_ns()
.Full Changelog: https://github.com/libbpf/libbpf/compare/v0.8.0...v1.0.0
Single backported AF_XDP fix on top of v0.8.1: https://github.com/libbpf/libbpf/pull/533