v0.13.0
版本发布时间: 2024-02-16 00:44:55
cilium/ebpf最新发布版本:v0.16.0(2024-07-24 17:40:43)
Faster btf.LoadKernelSpec()
Obtaining the kernel's BTF used to be very slow and is now very fast. See https://github.com/cilium/ebpf/pull/1235 by @lmb.
TCX
It's now possible to attach TC programs using the new bpf_link based TCX API. See https://github.com/cilium/ebpf/pull/1163 by @lmb.
UprobeMulti and UretprobeMulti
These are the user-space equivalents to KprobeMulti and Kretprobe multi and allow attaching to a large number of symbols quickly. See https://github.com/cilium/ebpf/pull/1269 by @olsajiri.
Netfilter link
There is now support to attach Netfilter programs using bpf_links. See https://github.com/cilium/ebpf/pull/1313 by @mehrdadrad.
Better ELF section naming compatibility
The list of recognised ELF section names is now automatically generated from libbpf and should be more accurate and easier to keep up to date. See https://github.com/cilium/ebpf/pull/1209 by @lmb.
Pre-allocate per-CPU values
It's now possible to cut down on allocations by pre-allocating per-CPU values. See https://github.com/cilium/ebpf/pull/1220 by @alxn.
Batch operation support for per-CPU values
Batch operations like Map.BatchLookup now support per-CPU values. Note that this is not particularly optimised, please check whether it is faster based on your use case. See https://github.com/cilium/ebpf/pull/1192 by @alxn.
Breaking changes
This release requires at least Go 1.21.
github.com/cilium/ebpf
-
(*Map).BatchLookup
,(*Map).BatchLookupAndDelete
: now take aMapBatchCursor
. The previous implementation did not properly account for differences between map types and was unsafe.
github.com/cilium/ebpf/btf
- CORERelocate: now takes an additional argument, which is usually
Spec.TypeID
. - MarshalExtInfos: now takes an additional
*Builder
instead of allocating it. Simply passNewBuilder()
.
Both of these are considered somewhat internal API of the library.
github.com/cilium/ebpf/features
-
HaveBoundedLoops
: changed from var to func -
HaveLargeInstructions
: changed from var to func -
HaveV2ISA
: changed from var to func -
HaveV3ISA
: changed from var to func
github.com/cilium/ebpf/link
-
QueryOptions.Path
: removed. Instead, pass an fd to the directory viaQueryOptions.Target
. -
QueryPrograms
: now returnsQueryResult
to be able to extend the API. -
RawAttachProgramOptions.Replace
: removed. Instead, passReplaceProgram()
toRawAttachProgramOptions.Anchor
.
What's Changed
- btf: fix CO-RE relocations for local type id by @lmb in https://github.com/cilium/ebpf/pull/1191
- fix data race by caching ring buffer size by @brycekahle in https://github.com/cilium/ebpf/pull/1217
- elf: generate ELF section patterns from libbpf by @lmb in https://github.com/cilium/ebpf/pull/1209
- Move PossibleCPUs to a public API by @alxn in https://github.com/cilium/ebpf/pull/1219
- CI: add go-apidiff check by @lmb in https://github.com/cilium/ebpf/pull/1225
- CI: fix trusted workflow by @lmb in https://github.com/cilium/ebpf/pull/1227
- CI: allow writing PRs from trusted workflow by @lmb in https://github.com/cilium/ebpf/pull/1228
- link: add TCX support by @lmb in https://github.com/cilium/ebpf/pull/1163
- map: allow pre-allocating per-CPU values on lookup by @alxn in https://github.com/cilium/ebpf/pull/1220
- CI: store apidiff as json artifact by @lmb in https://github.com/cilium/ebpf/pull/1229
- docs: split CONTRIBUTING.md into separate pages by @lmb in https://github.com/cilium/ebpf/pull/1221
- CI: add logging to trusted workflow by @lmb in https://github.com/cilium/ebpf/pull/1233
- Revert "CI: add logging to trusted workflow" by @lmb in https://github.com/cilium/ebpf/pull/1234
- add kfunc benchmark by @lmb in https://github.com/cilium/ebpf/pull/1231
- link: rename First, Last to Head, Tail by @lmb in https://github.com/cilium/ebpf/pull/1232
- docs: remove WIP pages by @lmb in https://github.com/cilium/ebpf/pull/1236
- go.mod: update golang.org/x/sys to v0.15.0 by @tklauser in https://github.com/cilium/ebpf/pull/1241
- map: avoid allocations in MapIterator.Next by @lmb in https://github.com/cilium/ebpf/pull/1243
- map: Introduce BatchCursor abstraction by @christarazi in https://github.com/cilium/ebpf/pull/1223
- Xabier/fix typos by @txabman42 in https://github.com/cilium/ebpf/pull/1248
- build(deps): bump pymdown-extensions from 10.3.1 to 10.5 in /docs by @dependabot in https://github.com/cilium/ebpf/pull/1246
- build(deps): bump mkdocs-material from 9.4.7 to 9.4.14 in /docs by @dependabot in https://github.com/cilium/ebpf/pull/1247
- map: fix flaky TestMapBatch/Hash by @lmb in https://github.com/cilium/ebpf/pull/1250
- CI: execute benchmarks once to prevent bitrot by @lmb in https://github.com/cilium/ebpf/pull/1244
- doc: use Sourcegraph query for list of importers by @lmb in https://github.com/cilium/ebpf/pull/1252
- test: Migrate tests to github.com/go-quicktest/qt by @sayboras in https://github.com/cilium/ebpf/pull/1253
- map: avoid allocations during batch lookup of common types by @lmb in https://github.com/cilium/ebpf/pull/1254
- CI: run tests on arm64 by @lmb in https://github.com/cilium/ebpf/pull/1245
- map: Fix MapBatch test for BatchLookupAndDelete case by @lmb in https://github.com/cilium/ebpf/pull/1260
- link: fix TestUprobeExtWithOpts address by @rgo3 in https://github.com/cilium/ebpf/pull/1272
- cmd/bpf2go: rephrase GOPACKAGE error message by @lmb in https://github.com/cilium/ebpf/pull/1267
- run-tests: fetch kernels and selftests from containers by @lmb in https://github.com/cilium/ebpf/pull/1264
- GH: use an issue form for bug reports by @lmb in https://github.com/cilium/ebpf/pull/1268
- program: fix raw_tracepoint run repeat check bug by @mtardy in https://github.com/cilium/ebpf/pull/1275
- fix make update-kernel-deps by @lmb in https://github.com/cilium/ebpf/pull/1276
- Add per-CPU Map Support to Batch Operations by @alxn in https://github.com/cilium/ebpf/pull/1192
- build(deps): bump mkdocs-material from 9.4.14 to 9.5.3 in /docs by @dependabot in https://github.com/cilium/ebpf/pull/1285
- build(deps): bump mkdocs-git-revision-date-localized-plugin from 1.2.1 to 1.2.2 in /docs by @dependabot in https://github.com/cilium/ebpf/pull/1287
- perf: fix nil pointer when perf map create failed by @cfc4n in https://github.com/cilium/ebpf/pull/1282
- Fix link.Info.XDP comment to match method name by @aibor in https://github.com/cilium/ebpf/pull/1292
- Add link.Info.TCX method by @aibor in https://github.com/cilium/ebpf/pull/1293
- link: add feature test for tcx by @rgo3 in https://github.com/cilium/ebpf/pull/1294
- cmd/bpf2go: Make LoongArch a supported target by @chenhengqi in https://github.com/cilium/ebpf/pull/1296
- features: fix documentation by @lmb in https://github.com/cilium/ebpf/pull/1299
- build(deps): bump gitpython from 3.1.40 to 3.1.41 in /docs by @dependabot in https://github.com/cilium/ebpf/pull/1302
- link: fix tcx feature test by @rgo3 in https://github.com/cilium/ebpf/pull/1303
- build(deps): bump jinja2 from 3.1.2 to 3.1.3 in /docs by @dependabot in https://github.com/cilium/ebpf/pull/1305
- cmd/bpf2go: clean up goarch / clang / linux target handling by @lmb in https://github.com/cilium/ebpf/pull/1310
- add kernel 6.7 by @lmb in https://github.com/cilium/ebpf/pull/1314
- btf: fix slow LoadKernelSpec by making Spec.Copy lazy by @lmb in https://github.com/cilium/ebpf/pull/1235
- cmd/bpf2go: fix s390x target by @lmb in https://github.com/cilium/ebpf/pull/1312
- map: Make the Examples all testable examples. by @alxn in https://github.com/cilium/ebpf/pull/1278
- Add support for uprobe multi link by @olsajiri in https://github.com/cilium/ebpf/pull/1269
- link: add netfilter support by @mehrdadrad in https://github.com/cilium/ebpf/pull/1313
- bpf2go: support specifying output directory and package name by @chent1996 in https://github.com/cilium/ebpf/pull/1280
- build(deps): bump mkdocs-material from 9.5.3 to 9.5.6 in /docs by @dependabot in https://github.com/cilium/ebpf/pull/1324
- bump minimum Go to 1.21 by @lmb in https://github.com/cilium/ebpf/pull/1331
- add support for reading auxv from Go runtime by @paulcacheux in https://github.com/cilium/ebpf/pull/1319
- dependabot: onboard github actions upgrades by @paulcacheux in https://github.com/cilium/ebpf/pull/1332
- build(deps): bump actions/checkout from 3 to 4 by @dependabot in https://github.com/cilium/ebpf/pull/1334
- use slices and maps packages instead of x/exp by @lmb in https://github.com/cilium/ebpf/pull/1333
- build(deps): bump actions/setup-python from 4 to 5 by @dependabot in https://github.com/cilium/ebpf/pull/1335
- build(deps): bump actions/github-script from 3 to 7 by @dependabot in https://github.com/cilium/ebpf/pull/1336
- build(deps): bump actions/upload-artifact from 3 to 4 by @dependabot in https://github.com/cilium/ebpf/pull/1337
- build(deps): bump mkdocs-git-revision-date-localized-plugin from 1.2.2 to 1.2.4 in /docs by @dependabot in https://github.com/cilium/ebpf/pull/1339
- build(deps): bump mkdocs-material from 9.5.6 to 9.5.8 in /docs by @dependabot in https://github.com/cilium/ebpf/pull/1340
- build(deps): bump actions/setup-go from 4 to 5 by @dependabot in https://github.com/cilium/ebpf/pull/1338
- internal: replace internal memoize with sync.OnceValues by @kwakubiney in https://github.com/cilium/ebpf/pull/1240
- fix minor contradiction in comments by @christian-2 in https://github.com/cilium/ebpf/pull/1341
- map: rename BatchCursor to MapBatchCursor by @lmb in https://github.com/cilium/ebpf/pull/1344
New Contributors
- @txabman42 made their first contribution in https://github.com/cilium/ebpf/pull/1248
- @sayboras made their first contribution in https://github.com/cilium/ebpf/pull/1253
- @mtardy made their first contribution in https://github.com/cilium/ebpf/pull/1275
- @cfc4n made their first contribution in https://github.com/cilium/ebpf/pull/1282
- @chent1996 made their first contribution in https://github.com/cilium/ebpf/pull/1280
- @christian-2 made their first contribution in https://github.com/cilium/ebpf/pull/1341
Full Changelog: https://github.com/cilium/ebpf/compare/v0.12.3...v0.13.0