cilium/ebpf v0.20.0

release ·

Performance Improvements

New Features

Bugfixes

Windows Support Improvements

Breaking Changes

ProgramOptions.KernelModuleTypes removed

The KernelModuleTypes field in ProgramOptions has been removed. In 99% of cases this field should not be necessary anymore. Module BTF should be merged into the vmlinux BTF, as tools like btfhub do.

For advanced use cases that still require passing additional BTF specs for CO-RE relocations, use the new ExtraRelocationTargets field:

Before:

opts := &ebpf.ProgramOptions{
    KernelModuleTypes: map[string]*btf.Spec{
        "module1": moduleSpec1,
    },
}

After:

// Merge module BTF into vmlinux BTF (recommended)
// Or for advanced cases:
opts := &ebpf.ProgramOptions{
    ExtraRelocationTargets: []*btf.Spec{
        moduleSpec1,
    },
}

btf.Cache fields unexported

The KernelTypes, ModuleTypes, and LoadedModules fields in btf.Cache have been unexported. These fields were internal implementation details and should not have been accessed directly. Users should continue using btf.NewCache() to create cache instances - no code changes are needed if you weren’t directly accessing these fields.

cache := btf.NewCache()
cache.KernelTypes = mySpec  // This will no longer compile

What’s Changed

New Contributors

Full Changelog: https://github.com/cilium/ebpf/compare/v0.19.0...v0.20.0

View source