Skip to content

Instantly share code, notes, and snippets.

@grantseltzer
Last active June 28, 2022 18:59
Show Gist options
  • Save grantseltzer/418a8435068412cee41c0db329aa6230 to your computer and use it in GitHub Desktop.
Save grantseltzer/418a8435068412cee41c0db329aa6230 to your computer and use it in GitHub Desktop.
libbpfgo release notes
# v0.3.0-libbpf-0.8.0
This release of libbpfgo now provides official support for statically/dynamically linking libbpf v0.8.0!!!
Breaking Changes
- `ListProgramNames` API was removed
- `GetUnsafePointer` was removed
New APIs
- `BPFMap.SetValueSize()` (calls libbpf bpf_map__set_value_size) #156
- `BPFMap.GetValueReadInto()` (calls libbpf bpf_map__lookup_elem) #156
- This enables the use per-cpu arrays, hashmaps, and storage!
- `BPFObjectIterator`! #166
- Allows for iterating over each map and program in a BPF object
- Uses libbpf bpf_object__next_program and bpf_object__next_map
- `GetSectionName` (calls libbpf bpf_program__section_name) #166
- `GetValueFlags()`/`UpdateValueFlags()` #154
- The enables passing a `MapFlag` argument to the bpf helper functions `bpf_map_update_elem` and `bpf_map_lookup_elem_flags`
- `BPFProg.AttachXDP()` (calls libbpf bpf_program__attach_xdp) #170
- `BPFProg.GetSectionName()` (calls libbpf bpf_program_-section_name) #164
- `BPFMapTypeIsSupported()`/`BPFProgramTypeIsSupported()` #164
- `SetStrictMode()` (calls libbpf_set_strict_mode) #160
- `BPFLink.Pin()`/`BPFLink.Unpin()` (calls libbpf bpf_link__pin/unpin) #144
- `BPFProg.AttachGeneric()` (calls libbpf bpf_program__attach) #144
- Allows for autodetection of bpf program and attach types! This is useful for tracing programs
- `BPFProg.SetAttachTarget()`/`BPFProg.SetAttachType`/`BPFProg.SetProgramType` #144
New Helpers
- You can now use a range of new helpers for parsing options passed to socket syscalls such as `setsockopt` and `getsockopt` #181
- `CreateMap()` (calls bpf_map_create) #138
- `BPFMap.Name()`/`BPFMap.Type` (calls libbpf bpf_map__name/bpf_map__type) #138
- `BPFMap.SetType()` (calls libbpf bpf_map__set_type) #138
New Selftests/examples
- Fentry BPF_PROG_TYPE_TRACING sample #144
- Fentry set attach target selftest #144
- New tc selftest
- New XDP selftest
- Removed the faulty tcpconnect selftest
- VersionString selftest
Fixes
- Kernel symbol helpers will no longer have errant square brackets #153
- Support for arm64 fixes #158
- A lot of error handling fixes #163 #157, #152, #146, #142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment