Skip to content

v0.13.0

Compare
Choose a tag to compare
@lmb lmb released this 15 Feb 16:44
· 249 commits to main since this release

Faster btf.LoadKernelSpec()

Obtaining the kernel's BTF used to be very slow and is now very fast. See #1235 by @lmb.

TCX

It's now possible to attach TC programs using the new bpf_link based TCX API. See #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 #1269 by @olsajiri.

Netfilter link

There is now support to attach Netfilter programs using bpf_links. See #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 #1209 by @lmb.

Pre-allocate per-CPU values

It's now possible to cut down on allocations by pre-allocating per-CPU values. See #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 #1192 by @alxn.

Breaking changes

This release requires at least Go 1.21.

github.com/cilium/ebpf

  • (*Map).BatchLookup, (*Map).BatchLookupAndDelete: now take a MapBatchCursor.
    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 pass NewBuilder().

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 via QueryOptions.Target.
  • QueryPrograms: now returns QueryResult to be able to extend the API.
  • RawAttachProgramOptions.Replace: removed. Instead, pass ReplaceProgram() to RawAttachProgramOptions.Anchor.

What's Changed

  • btf: fix CO-RE relocations for local type id by @lmb in #1191
  • fix data race by caching ring buffer size by @brycekahle in #1217
  • elf: generate ELF section patterns from libbpf by @lmb in #1209
  • Move PossibleCPUs to a public API by @alxn in #1219
  • CI: add go-apidiff check by @lmb in #1225
  • CI: fix trusted workflow by @lmb in #1227
  • CI: allow writing PRs from trusted workflow by @lmb in #1228
  • link: add TCX support by @lmb in #1163
  • map: allow pre-allocating per-CPU values on lookup by @alxn in #1220
  • CI: store apidiff as json artifact by @lmb in #1229
  • docs: split CONTRIBUTING.md into separate pages by @lmb in #1221
  • CI: add logging to trusted workflow by @lmb in #1233
  • Revert "CI: add logging to trusted workflow" by @lmb in #1234
  • add kfunc benchmark by @lmb in #1231
  • link: rename First, Last to Head, Tail by @lmb in #1232
  • docs: remove WIP pages by @lmb in #1236
  • go.mod: update golang.org/x/sys to v0.15.0 by @tklauser in #1241
  • map: avoid allocations in MapIterator.Next by @lmb in #1243
  • map: Introduce BatchCursor abstraction by @christarazi in #1223
  • Xabier/fix typos by @txabman42 in #1248
  • build(deps): bump pymdown-extensions from 10.3.1 to 10.5 in /docs by @dependabot in #1246
  • build(deps): bump mkdocs-material from 9.4.7 to 9.4.14 in /docs by @dependabot in #1247
  • map: fix flaky TestMapBatch/Hash by @lmb in #1250
  • CI: execute benchmarks once to prevent bitrot by @lmb in #1244
  • doc: use Sourcegraph query for list of importers by @lmb in #1252
  • test: Migrate tests to github.com/go-quicktest/qt by @sayboras in #1253
  • map: avoid allocations during batch lookup of common types by @lmb in #1254
  • CI: run tests on arm64 by @lmb in #1245
  • map: Fix MapBatch test for BatchLookupAndDelete case by @lmb in #1260
  • link: fix TestUprobeExtWithOpts address by @rgo3 in #1272
  • cmd/bpf2go: rephrase GOPACKAGE error message by @lmb in #1267
  • run-tests: fetch kernels and selftests from containers by @lmb in #1264
  • GH: use an issue form for bug reports by @lmb in #1268
  • program: fix raw_tracepoint run repeat check bug by @mtardy in #1275
  • fix make update-kernel-deps by @lmb in #1276
  • Add per-CPU Map Support to Batch Operations by @alxn in #1192
  • build(deps): bump mkdocs-material from 9.4.14 to 9.5.3 in /docs by @dependabot in #1285
  • build(deps): bump mkdocs-git-revision-date-localized-plugin from 1.2.1 to 1.2.2 in /docs by @dependabot in #1287
  • perf: fix nil pointer when perf map create failed by @cfc4n in #1282
  • Fix link.Info.XDP comment to match method name by @aibor in #1292
  • Add link.Info.TCX method by @aibor in #1293
  • link: add feature test for tcx by @rgo3 in #1294
  • cmd/bpf2go: Make LoongArch a supported target by @chenhengqi in #1296
  • features: fix documentation by @lmb in #1299
  • build(deps): bump gitpython from 3.1.40 to 3.1.41 in /docs by @dependabot in #1302
  • link: fix tcx feature test by @rgo3 in #1303
  • build(deps): bump jinja2 from 3.1.2 to 3.1.3 in /docs by @dependabot in #1305
  • cmd/bpf2go: clean up goarch / clang / linux target handling by @lmb in #1310
  • add kernel 6.7 by @lmb in #1314
  • btf: fix slow LoadKernelSpec by making Spec.Copy lazy by @lmb in #1235
  • cmd/bpf2go: fix s390x target by @lmb in #1312
  • map: Make the Examples all testable examples. by @alxn in #1278
  • Add support for uprobe multi link by @olsajiri in #1269
  • link: add netfilter support by @mehrdadrad in #1313
  • bpf2go: support specifying output directory and package name by @chent1996 in #1280
  • build(deps): bump mkdocs-material from 9.5.3 to 9.5.6 in /docs by @dependabot in #1324
  • bump minimum Go to 1.21 by @lmb in #1331
  • add support for reading auxv from Go runtime by @paulcacheux in #1319
  • dependabot: onboard github actions upgrades by @paulcacheux in #1332
  • build(deps): bump actions/checkout from 3 to 4 by @dependabot in #1334
  • use slices and maps packages instead of x/exp by @lmb in #1333
  • build(deps): bump actions/setup-python from 4 to 5 by @dependabot in #1335
  • build(deps): bump actions/github-script from 3 to 7 by @dependabot in #1336
  • build(deps): bump actions/upload-artifact from 3 to 4 by @dependabot in #1337
  • build(deps): bump mkdocs-git-revision-date-localized-plugin from 1.2.2 to 1.2.4 in /docs by @dependabot in #1339
  • build(deps): bump mkdocs-material from 9.5.6 to 9.5.8 in /docs by @dependabot in #1340
  • build(deps): bump actions/setup-go from 4 to 5 by @dependabot in #1338
  • internal: replace internal memoize with sync.OnceValues by @kwakubiney in #1240
  • fix minor contradiction in comments by @christian-2 in #1341
  • map: rename BatchCursor to MapBatchCursor by @lmb in #1344

New Contributors

Full Changelog: v0.12.3...v0.13.0