Documentation ¶
Index ¶
- Constants
- func DumpVrInterfaces() (*[]VrouterIface, error)
- func GetBpfError(p *C.struct_btf) error
- func InitKprobe(btf_file string, args SymbolDbArgs) (*bpf.PerfBuffer, error)
- func IsVrouterKmodLoaded() bool
- type BTF
- type BTFKind
- type BTFType
- func (t *BTFType) IsArray() bool
- func (t *BTFType) IsComposite() bool
- func (t *BTFType) IsConst() bool
- func (t *BTFType) IsDataSec() bool
- func (t *BTFType) IsDeclTag() bool
- func (t *BTFType) IsEnum() bool
- func (t *BTFType) IsFloat() bool
- func (t *BTFType) IsFunc() bool
- func (t *BTFType) IsFuncProto() bool
- func (t *BTFType) IsFwd() bool
- func (t *BTFType) IsInt() bool
- func (t *BTFType) IsMod() bool
- func (t *BTFType) IsPtr() bool
- func (t *BTFType) IsRestrict() bool
- func (t *BTFType) IsStruct() bool
- func (t *BTFType) IsTypeTag() bool
- func (t *BTFType) IsTypedef() bool
- func (t *BTFType) IsUnion() bool
- func (t *BTFType) IsVar() bool
- func (t *BTFType) IsVoid() bool
- func (t *BTFType) IsVolatile() bool
- type BtfFuncProto
- type KprobePerfEvent
- type PlatformInfo
- type Sandesh
- type SymbolDb
- func (symsdb *SymbolDb) CountPos2Func() int
- func (symsdb *SymbolDb) FindSymByFaddr(faddr uint64) (string, error)
- func (symsdb *SymbolDb) IsAvailFilter(fname string) bool
- func (symsdb *SymbolDb) PopulateAvailableFunctions() error
- func (symsdb *SymbolDb) PopulateKallSyms() error
- func (symsdb *SymbolDb) PopulatePos2Func(args *SymbolDbArgs) error
- type SymbolDbArgs
- type VrfraceKprobeSpec
- type VrouterIface
Constants ¶
View Source
const ATTACH_RESULT_FMT = "\rAttaching program (total: %d, succeeded: %d)"
View Source
const KprobeBPFProg = "/tmp/vrftrace_kprobe.bpf.o"
View Source
const NL_ATTR_VR_MESSAGE_PROTOCOL = 1
View Source
const SANDESH_REQUEST = 1
View Source
const ULLONG_MAX = 0xffffffffffffffff
Variables ¶
This section is empty.
Functions ¶
func DumpVrInterfaces ¶
func DumpVrInterfaces() (*[]VrouterIface, error)
func GetBpfError ¶
func GetBpfError(p *C.struct_btf) error
* libbpf pointer into a stderr code (or 0 if the pointer is valid)
func InitKprobe ¶
func InitKprobe(btf_file string, args SymbolDbArgs) (*bpf.PerfBuffer, error)
func IsVrouterKmodLoaded ¶
func IsVrouterKmodLoaded() bool
check if vrouter.ko is loaded on the system from /proc/module. See: How to find information about the kernel modules installed on the system https://access.redhat.com/solutions/4246821
Types ¶
type BTF ¶
type BTF struct {
Btf *C.struct_btf
}
func LoadVmlinuxBtf ¶
* Probe few well-known locations for vmlinux kernel image and try to load BTF * data out of it to use for target BTF.
func (*BTF) BtfFuncProto ¶
func (vmlinux_btf *BTF) BtfFuncProto(btf_type *BTFType, id int) BtfFuncProto
* Resolve function proto from the BTF
func (*BTF) LoadModuleBTF ¶
* used to load module BTF, overrides with loaded BTF
type BTFKind ¶
type BTFKind uint16
const ( BTF_KIND_UNKN BTFKind = iota /* Unknown */ BTF_KIND_INT /* Integer */ BTF_KIND_PTR /* Pointer */ BTF_KIND_ARRAY /* Array */ BTF_KIND_STRUCT /* Struct */ BTF_KIND_UNION /* Union */ BTF_KIND_ENUM /* Enumeration */ BTF_KIND_FWD /* Forward */ BTF_KIND_TYPEDEF /* Typedef */ BTF_KIND_VOLATILE /* Volatile */ BTF_KIND_CONST /* Const */ BTF_KIND_RESTRICT /* Restrict */ BTF_KIND_FUNC /* Function */ BTF_KIND_FUNC_PROTO /* Function Proto */ BTF_KIND_VAR /* Variable */ BTF_KIND_DATASEC /* Section */ BTF_KIND_FLOAT /* Floating point */ BTF_KIND_DECL_TAG /* Decl Tag */ BTF_KIND_TYPE_TAG /* Type Tag */ NR_BTF_KINDS BTF_KIND_MAX = NR_BTF_KINDS - 1 )
type BTFType ¶
type BTFType struct { NameOff uint32 /* "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd */ Info uint32 /* "type" is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT, * FUNC, FUNC_PROTO, VAR, DECL_TAG and TYPE_TAG. * "type" is a type_id referring to another type. */ Type uint32 // kind of this BTF type Kind string // Name of this BTF type Name string // contains filtered or unexported fields }
func (*BTFType) IsComposite ¶
func (*BTFType) IsFuncProto ¶
func (*BTFType) IsRestrict ¶
func (*BTFType) IsVolatile ¶
type BtfFuncProto ¶
type KprobePerfEvent ¶
type PlatformInfo ¶
type PlatformInfo struct { OsDist string OsID string OsVersion string KernelVersion string IsDebugInfoBtfEnabled bool }
func GetPlatformInfo ¶
func GetPlatformInfo() (*PlatformInfo, error)
type Sandesh ¶
type Sandesh struct {
// contains filtered or unexported fields
}
Sandesh protocol and transport
func (*Sandesh) SendVifDumpRequest ¶
send vr_interface_req with dump_op to vrouter kernel
type SymbolDb ¶
type SymbolDb struct { AvailFunc map[string]bool FuncAddr map[uint64]string Pos2Func map[string]map[string]int }
func InitSymbolDb ¶
func InitSymbolDb(args *SymbolDbArgs) (*SymbolDb, error)
func (*SymbolDb) CountPos2Func ¶
func (*SymbolDb) FindSymByFaddr ¶
func (*SymbolDb) IsAvailFilter ¶
func (*SymbolDb) PopulateAvailableFunctions ¶
func (*SymbolDb) PopulateKallSyms ¶
func (*SymbolDb) PopulatePos2Func ¶
func (symsdb *SymbolDb) PopulatePos2Func(args *SymbolDbArgs) error
type SymbolDbArgs ¶
type VrfraceKprobeSpec ¶
type VrfraceKprobeSpec struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.