v0.12.0
This release requires at least Go 1.20. It is mainly a bugfix release without any expected breaking changes. Map operations have also been made faster on the Go side.
Fixes
Correctly freeze .rodata
maps
.rodata
maps were frozen after programs referring to them were loaded, preventing the verifier from eliminating dead code based on the contents of the .rodata
maps. Upgrade if you're running into odd verifier errors that don't occur on libbpf.
See #1159.
Fix fd leak in error path of kfunc support
The library leaked file descriptors when trying to use non-existent kfuncs.
See #1145.
Fix incorrect formatting of signed BTF enums with negative values
Signed enums with negative values were incorrectly formatted, leading to invalid output from bpf2go
.
See #1155.
Additions
Map operations using common types are much faster
Keys and values used in map operations were indiscriminately passed through the encoding/binary
package. There is now a fast path which skips this step when the in-memory layout of a type is equivalent to the output produced by binary.Write
. The result is less allocations and CPU usage.
The optimization doesn't apply to per-CPU maps.
See #1062.
What's Changed
- .semaphore: rename master to main by @lmb in #1092
- improv: make errors more conclusive by @kwakubiney in #1071
- elf: don't clamp PerfEventArray.MaxEntries at parse time by @lmb in #1094
- internal/sys: make generate-btf and regenerate types by @florianl in #1105
- all: fix typos in comments and tests by @alexandear in #1109
- Add riscv64 Linux string by @hack3ric in #1110
- go: require v1.20 by @lmb in #1112
- testutils: log random seed to test output by @lmb in #1113
- Ringbuf read on timeout by @RonFed in #1111
- elf: don't set BPF_F_MMAPABLE on .kconfig by @lmb in #1128
- implementation for hinting on possible error on map create with noPrealloc flag set by @kwakubiney in #1102
- docker: rebuild ebpf-builder to include go 1.20 by @lmb in #1130
- CI: test against 6.1 by @lmb in #1131
- Add metadata to instructions returned by program info by @dylandreimerink in #1118
- Support attaching fentry / fexit on user-defined programs by @jschwinger233 in #1097
- map: zero-allocation operations for common types by @lmb in #1062
- elf_reader_test: check for bpf_testmod before running TestInvalidKfunc by @ti-mo in #1135
- CI: add github actions by @lmb in #1134
- btf: work around missing ENUM64 support by @lmb in #1132
- run-tests: support new packaging by @lmb in #1091
- Update bpf2go and stringer go:generate statements across the codebase by @ti-mo in #1140
- Drop LLVM 7 and 9 in favor of 11, 14 and 17 by @ti-mo in #1141
- btf: clean up some small things by @lmb in #1139
- CI: update apt repositories by @lmb in #1146
- linker: fix fd leak in fixupKfuncs by @lmb in #1145
- Project documentation website by @ti-mo in #1017
- dependabot: add configuration, ignore indirect Python dependencies by @ti-mo in #1148
- build(deps): bump mkdocs-material from 9.3.2 to 9.4.3 in /docs by @dependabot in #1150
- bpf2go,collection: fix typos in test and comment by @alexandear in #1138
- docs: remove partials override for content.html by @ti-mo in #1153
- sys: small cleanups by @lmb in #1154
- docs: copy shorthands to clipboard in getting-started by @ti-mo in #1158
- testdata: drop the use of clang_major directive by @ti-mo in #1151
- btf: fix writing out signed enums by @lmb in #1155
- elf: assume BTF support in loader tests by @lmb in #1161
- elf: Add support for map struct typedef by @anjmao in #1125
- Freeze .rodata before trying to load programs by @ti-mo in #1159
New Contributors
- @alexandear made their first contribution in #1109
- @hack3ric made their first contribution in #1110
- @RonFed made their first contribution in #1111
- @jschwinger233 made their first contribution in #1097
- @dependabot made their first contribution in #1150
- @anjmao made their first contribution in #1125
Full Changelog: v0.11.0...v0.12.0