#1218·ebpf

btf: move wire type definitions into sys

Author: lmbCreated Nov 10, 2023Updated May 7, 2025

btf_types.go contains a bunch of hand written structs that map to types defined in the kernel's UAPI. We should replace these with auto generated types in sys package and use those from btf. This guarantees that we match the kernel 1:1 and also ensures that there is no implicit padding present.

  • btfType
  • btfEnum
  • btfArray
  • btfMember
  • btfParam
  • btfVar
  • btfVarSecInfo
  • btfDeclTag
  • btfEnum64

The changes need to be made here: https://github.com/cilium/ebpf/blob/0acd95c6c83cabeff32e94594cd4b7de6e7df4a2/internal/cmd/gentypes/main.go#L157-L208