Open lmb opened 11 months ago
I see bunch of helper functions and methods in btf_types.go
. are we gonna keep them inside that file and just auto generate the structs inside sys
package?
@lmb
We could move those into a separate file in sys
. That way we can have manually written methods on auto generated types.
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.
The changes need to be made here: https://github.com/cilium/ebpf/blob/0acd95c6c83cabeff32e94594cd4b7de6e7df4a2/internal/cmd/gentypes/main.go#L157-L208