v0.8.0
版本发布时间: 2022-01-21 23:32:46
cilium/ebpf最新发布版本:v0.16.0(2024-07-24 17:40:43)
We're happy to announce our first release of 2022!
Breaking Changes
- Deprecations
- Deprecate
StructOpts
andperf.IsClosed()
by @ti-mo in https://github.com/cilium/ebpf/pull/547
- Deprecate
-
cmd/bpf2go: strip DWARF info by @lmb in https://github.com/cilium/ebpf/pull/481 DWARF info is now stripped from compiled BPF objects by default when using bpf2go, resulting in significant savings in object size. It can be re-enabled if desired.
-
elf_reader: emit
UnspecifiedProgram
s intoCollectionSpec
by @ti-mo in https://github.com/cilium/ebpf/pull/529 Previously,ProgramSpec
s were not emitted toCollectionSpec.Programs
if their ELF section names were not recognized. This limitation has been lifted: programs that are explicitly assigned to an ELF section will now always appear in the CollectionSpec, though they will all be of typeUnspecifiedProgram
. TheSectionName
field was added to help the user determine program types manually. -
map: make Map.Extra field a pointer to a bytes.Reader by @ti-mo in https://github.com/cilium/ebpf/pull/546 A last-minute addition, no longer allocate an empty
bytes.Reader
for everyMap
, as this is generally only used when loading legacy programs with iproute2 map definitions. If you're using this field, check fornil
before accessing.
Features
- automatically generate syscall wrappers by @lmb in https://github.com/cilium/ebpf/pull/425
- asm: update eBPF built-in functions by @florianl in https://github.com/cilium/ebpf/pull/459
- program: add program type syscall by @florianl in https://github.com/cilium/ebpf/pull/458
- Add v5.14 to CI builds by @lmb in https://github.com/cilium/ebpf/pull/462
- Improve kernel 4.4.x compatibility by @nplanel in https://github.com/cilium/ebpf/pull/436
- Add BTFIDLink to support fentry/fexit/fmod_ret/tp_raw/lsm BPF programs by @mehrdadrad in https://github.com/cilium/ebpf/pull/460
- link/uprobe: support ref_ctr_offset by @mmat11 in https://github.com/cilium/ebpf/pull/463
- Allows user space to update/lookup map elements under bpf_spin_lock by @mehrdadrad in https://github.com/cilium/ebpf/pull/473
- Makefile: prefer podman for container engine by @syscll in https://github.com/cilium/ebpf/pull/480
- asm: add Instructions.SizeBytes() for convenience and readability by @ti-mo in https://github.com/cilium/ebpf/pull/492
- Link: add XDP support by @mehrdadrad in https://github.com/cilium/ebpf/pull/484
- link: add LoadPinnedLink by @lmb in https://github.com/cilium/ebpf/pull/491
- implement BPF_PROG_BIND_MAP by @florianl in https://github.com/cilium/ebpf/pull/485
- use clang 13 by @lmb in https://github.com/cilium/ebpf/pull/488
- Read LINUX_VERSION_CODE from vDSO ELF header instead of uname by @brycekahle in https://github.com/cilium/ebpf/pull/500
- cmd/bpf2go: infer llvm-strip suffix from clang binary by @lmb in https://github.com/cilium/ebpf/pull/504
- Add support for function pointers by @pippolo84 in https://github.com/cilium/ebpf/pull/499
- prog: update program types from libbpf by @mehrdadrad in https://github.com/cilium/ebpf/pull/496
- btf: rename FindType to TypeByName, add TypesByName and TypeByID methods by @ti-mo in https://github.com/cilium/ebpf/pull/503
- btf: support raw BTF in LoadSpecFromReader by @lmb in https://github.com/cilium/ebpf/pull/520
- cmd/bpf2go: allow to specify native target by @tklauser in https://github.com/cilium/ebpf/pull/526
- asm: Add Jump32 support by @arthurfabre in https://github.com/cilium/ebpf/pull/514
- link: expose link info with type-specific information by @mehrdadrad in https://github.com/cilium/ebpf/pull/509
- Adopt Go 1.18 fuzzing and fix btf crashes by @lmb in https://github.com/cilium/ebpf/pull/530
- elf_reader,btf: support multiple programs per ELF section by @ti-mo in https://github.com/cilium/ebpf/pull/508
- Eliminate binary.Read in instruction (un)marshaler by @ti-mo in https://github.com/cilium/ebpf/pull/532
- program: retrieve xlated Instructions from Program by @ti-mo in https://github.com/cilium/ebpf/pull/538
- Support attaching SocketFilter programs to raw sockets by @folbricht in https://github.com/cilium/ebpf/pull/540
Bug Fixes
- CI: add
make clean
before testdata rebuild by @ti-mo in https://github.com/cilium/ebpf/pull/450 - sys: avoid zero fd by @lmb in https://github.com/cilium/ebpf/pull/454
- run-tests: don't require CI_MAX_KERNEL_VERSION to be set by @lmb in https://github.com/cilium/ebpf/pull/470
- features: fix HaveProgType(ebpf.Syscall) by @rgo3 in https://github.com/cilium/ebpf/pull/471
- elf: fix some typos in getProgType by @alxn in https://github.com/cilium/ebpf/pull/493
- CI: work around hung agents by @lmb in https://github.com/cilium/ebpf/pull/516
- link: switch tests from printk to vprintk symbol by @ti-mo in https://github.com/cilium/ebpf/pull/518
- map: allow empty ProgramArray to not be assigned by @lmb in https://github.com/cilium/ebpf/pull/513
- prog: don't panic when prog load EPERMs with empty verifier log by @ti-mo in https://github.com/cilium/ebpf/pull/519
- map, prog: fix typo in MEMLOCK error string by @tklauser in https://github.com/cilium/ebpf/pull/527
- btf: only return exact matches from AnyTypesByName by @lmb in https://github.com/cilium/ebpf/pull/525
- Remove BTF type IDs on map creation if not supported by @chenhengqi in https://github.com/cilium/ebpf/pull/534
- rlimit: avoid lowering Max rlimit by @ti-mo in https://github.com/cilium/ebpf/pull/533
- linker: Allow calling into unimplemented forward function declarations by @ti-mo in https://github.com/cilium/ebpf/pull/544
Documentation
- cmd/bpf2go: move doc to README by @lmb in https://github.com/cilium/ebpf/pull/446
Examples
- reproducible builds for examples by @lmb in https://github.com/cilium/ebpf/pull/417
- examples: added cgroup_skb example by @mingleiw in https://github.com/cilium/ebpf/pull/465
- Add fentry example by @mehrdadrad in https://github.com/cilium/ebpf/pull/482
- examples: add $BPF_STRIP to bpf2go invocation by @lmb in https://github.com/cilium/ebpf/pull/498
- tidy up examples by @lmb in https://github.com/cilium/ebpf/pull/521
New Contributors
During this release cycle, we've welcomed the following new contributors:
- @nplanel made their first contribution in https://github.com/cilium/ebpf/pull/436
- @mingleiw made their first contribution in https://github.com/cilium/ebpf/pull/465
- @syscll made their first contribution in https://github.com/cilium/ebpf/pull/478
- @alxn made their first contribution in https://github.com/cilium/ebpf/pull/493
- @chenhengqi made their first contribution in https://github.com/cilium/ebpf/pull/534
Thanks to all contributors for your support!
Full Changelog: https://github.com/cilium/ebpf/compare/v0.7.0...v0.8.0