Versions in this module Expand all Collapse all v0 v0.10.1 Jun 27, 2023 v0.10.0 Jun 26, 2023 Changes in this version + var ErrMultipleMatches = errors.New("multiple matching types") + var ErrNoExtendedInfo = errors.New("no extended info") + var ErrNotFound = errors.New("not found") + var ErrNotSupported = internal.ErrNotSupported + var FuncInfoSize = uint32(binary.Size(bpfFuncInfo{})) + var LineInfoSize = uint32(binary.Size(bpfLineInfo{})) + func CheckTypeCompatibility(localType Type, targetType Type) error + func LoadSpecAndExtInfosFromReader(rd io.ReaderAt) (*Spec, *ExtInfos, error) + func MarshalMapKV(key, value Type) (_ *Handle, keyID, valueID TypeID, err error) + func Sizeof(typ Type) (int, error) + func WithFuncMetadata(ins asm.Instruction, fn *Func) asm.Instruction + type Array struct + Index Type + Nelems uint32 + Type Type + func (arr *Array) Format(fs fmt.State, verb rune) + func (arr *Array) TypeName() string + type Bits uint32 + func (b Bits) Bytes() uint32 + type Builder struct + func NewBuilder(types []Type) (*Builder, error) + func (b *Builder) Add(typ Type) (TypeID, error) + func (b *Builder) Marshal(buf []byte, opts *MarshalOptions) ([]byte, error) + type COREFixup struct + func CORERelocate(relos []*CORERelocation, target *Spec, bo binary.ByteOrder) ([]COREFixup, error) + func (f *COREFixup) Apply(ins *asm.Instruction) error + func (f *COREFixup) String() string + type CORERelocation struct + func CORERelocationMetadata(ins *asm.Instruction) *CORERelocation + type Const struct + Type Type + func (c *Const) Format(fs fmt.State, verb rune) + func (c *Const) TypeName() string + type Datasec struct + Name string + Size uint32 + Vars []VarSecinfo + func (ds *Datasec) Format(fs fmt.State, verb rune) + func (ds *Datasec) TypeName() string + type Enum struct + Name string + Signed bool + Size uint32 + Values []EnumValue + func (e *Enum) Format(fs fmt.State, verb rune) + func (e *Enum) TypeName() string + type EnumValue struct + Name string + Value uint64 + type ExtInfos struct + func (ei *ExtInfos) Assign(insns asm.Instructions, section string) + type Float struct + Name string + Size uint32 + func (f *Float) Format(fs fmt.State, verb rune) + func (f *Float) TypeName() string + type Func struct + Linkage FuncLinkage + Name string + Type Type + func FuncMetadata(ins *asm.Instruction) *Func + func (f *Func) Format(fs fmt.State, verb rune) + func (f *Func) TypeName() string + type FuncLinkage int + const ExternFunc + const GlobalFunc + const StaticFunc + func (i FuncLinkage) String() string + type FuncParam struct + Name string + Type Type + type FuncProto struct + Params []FuncParam + Return Type + func (fp *FuncProto) Format(fs fmt.State, verb rune) + func (fp *FuncProto) TypeName() string + type Fwd struct + Kind FwdKind + Name string + func (f *Fwd) Format(fs fmt.State, verb rune) + func (f *Fwd) TypeName() string + type FwdKind int + const FwdStruct + const FwdUnion + func (fk FwdKind) String() string + type GoFormatter struct + EnumIdentifier func(name, element string) string + Identifier func(string) string + Names map[Type]string + func (gf *GoFormatter) TypeDeclaration(name string, typ Type) (string, error) + type Handle struct + func FindHandle(predicate func(info *HandleInfo) bool) (*Handle, error) + func MarshalExtInfos(insns asm.Instructions) (_ *Handle, funcInfos, lineInfos []byte, _ error) + func NewHandle(b *Builder) (*Handle, error) + func NewHandleFromID(id ID) (*Handle, error) + func NewHandleFromRawBTF(btf []byte) (*Handle, error) + func (h *Handle) Close() error + func (h *Handle) FD() int + func (h *Handle) Info() (*HandleInfo, error) + func (h *Handle) Spec(base *Spec) (*Spec, error) + type HandleInfo struct + ID ID + IsKernel bool + Name string + func (i *HandleInfo) IsModule() bool + func (i *HandleInfo) IsVmlinux() bool + type HandleIterator struct + Handle *Handle + ID ID + func (it *HandleIterator) Err() error + func (it *HandleIterator) Next() bool + func (it *HandleIterator) Take() *Handle + type ID = sys.BTFID + type Int struct + Encoding IntEncoding + Name string + Size uint32 + func (i *Int) Format(fs fmt.State, verb rune) + func (i *Int) TypeName() string + type IntEncoding byte + const Bool + const Char + const Signed + const Unsigned + func (ie IntEncoding) String() string + type Line struct + func (li *Line) FileName() string + func (li *Line) Line() string + func (li *Line) LineColumn() uint32 + func (li *Line) LineNumber() uint32 + func (li *Line) String() string + type MarshalOptions struct + Order binary.ByteOrder + StripFuncLinkage bool + func KernelMarshalOptions() *MarshalOptions + type Member struct + BitfieldSize Bits + Name string + Offset Bits + Type Type + type Pointer struct + Target Type + func (p *Pointer) Format(fs fmt.State, verb rune) + func (p *Pointer) TypeName() string + type Restrict struct + Type Type + func (r *Restrict) Format(fs fmt.State, verb rune) + func (r *Restrict) TypeName() string + type Spec struct + func LoadSpec(file string) (*Spec, error) + func LoadSpecFromReader(rd io.ReaderAt) (*Spec, error) + func LoadSplitSpecFromReader(r io.ReaderAt, base *Spec) (*Spec, error) + func (s *Spec) AnyTypeByName(name string) (Type, error) + func (s *Spec) AnyTypesByName(name string) ([]Type, error) + func (s *Spec) Copy() *Spec + func (s *Spec) Iterate() *TypesIterator + func (s *Spec) TypeByID(id TypeID) (Type, error) + func (s *Spec) TypeByName(name string, typ interface{}) error + func (s *Spec) TypeID(typ Type) (TypeID, error) + type Struct struct + Members []Member + Name string + Size uint32 + func (s *Struct) Format(fs fmt.State, verb rune) + func (s *Struct) TypeName() string + type Transformer func(Type) Type + type Type interface + TypeName func() string + func Copy(typ Type, transform Transformer) Type + func UnderlyingType(typ Type) Type + type TypeID = sys.TypeID + type Typedef struct + Name string + Type Type + func (td *Typedef) Format(fs fmt.State, verb rune) + func (td *Typedef) TypeName() string + type TypesIterator struct + Type Type + func (iter *TypesIterator) Next() bool + type Union struct + Members []Member + Name string + Size uint32 + func (u *Union) Format(fs fmt.State, verb rune) + func (u *Union) TypeName() string + type Var struct + Linkage VarLinkage + Name string + Type Type + func (v *Var) Format(fs fmt.State, verb rune) + func (v *Var) TypeName() string + type VarLinkage int + const ExternVar + const GlobalVar + const StaticVar + func (i VarLinkage) String() string + type VarSecinfo struct + Offset uint32 + Size uint32 + Type Type + type Void struct + func (v *Void) Format(fs fmt.State, verb rune) + func (v *Void) TypeName() string + type Volatile struct + Type Type + func (v *Volatile) Format(fs fmt.State, verb rune) + func (v *Volatile) TypeName() string