bpf

package
v0.0.1-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NFSTracepointProgs = map[string]string{
		"nfs_init_read":  "nfs_initiate_read",
		"nfs_init_write": "nfs_initiate_write",
	}

	RPCTracepointProgs = map[string]string{
		"rpc_task_begin": "rpc_task_begin",
		"rpc_task_done":  "rpc_task_end",
	}
)
View Source
var (
	NFSKprobeProgs = map[string]string{
		"kb_nfs_write_d": "nfs_writeback_done",
		"kb_nfs_read_d":  "nfs_readpage_done",
		"rpc_exit_task":  "rpc_exit_task",
		"rpc_execute":    "rpc_make_runnable",
	}
)

Functions

func AttachKprobeMulti

func AttachKprobeMulti(ctx context.Context, bar *pb.ProgressBar, kprobes []Kprobe, a2n Addr2Name) (links []link.Link, ignored int)

AttachKprobeMulti attaches kprobe-multi serially.

func AttachKprobes

func AttachKprobes(ctx context.Context, bar *pb.ProgressBar, kps []Kprobe, batch uint) (links []link.Link, ignored int)

AttachKprobes attaches kprobes concurrently.

func AttachTracepoint

func AttachTracepoint(coll *ebpf.Collection) (*tracing, bool, error)

func GetFuncsByPos

func GetFuncsByPos(funcs Funcs) map[int][]string

func HaveAvailableFilterFunctions

func HaveAvailableFilterFunctions() bool

func HaveBPFLinkKprobeMulti

func HaveBPFLinkKprobeMulti() bool

Very hacky way to check whether multi-link kprobe is supported.

func HaveBPFLinkTracing

func HaveBPFLinkTracing() bool

Very hacky way to check whether tracing link is supported.

func IsTracepointExist

func IsTracepointExist(group, tracepointName string) bool

func NewByAddr

func NewByAddr() sort.Interface

func NewCustomFuncsKprober

func NewCustomFuncsKprober(manifest map[string]string, coll *ebpf.Collection) *kprober

func NewKprober

func NewKprober(ctx context.Context, funcs Funcs, coll *ebpf.Collection, a2n Addr2Name, useKprobeMulti bool, batch uint) *kprober

func ParseKallsyms

func ParseKallsyms(funcs Funcs, all bool) (Addr2Name, BpfProgName2Addr, error)

func Tracepoint

func Tracepoint(group string, progs map[string]*ebpf.Program) *tracing

Types

type Addr2Name

type Addr2Name struct {
	Addr2NameMap   map[uint64]*ksym
	Addr2NameSlice []*ksym
	Name2AddrMap   map[string][]uintptr
}

func (*Addr2Name) FindNearestSym

func (a *Addr2Name) FindNearestSym(ip uint64) string

type BpfProgName2Addr

type BpfProgName2Addr map[string]uint64

type FilterCfg

type FilterCfg struct {
	EnableDebug uint8
}

func GetConfig

func GetConfig(flags *Flags) (cfg FilterCfg, err error)

type Flags

type Flags struct {
	FilterFunc            string
	FilterStruct          string
	ModelBTF              string
	KernelBTF             string
	AllKMods              bool
	SkipAttach            bool
	AddFuncs              string
	LogLevel              int
	OutputDetails         bool
	OutPerformanceMetrics bool
	EnableDebug           bool
}

func (*Flags) SetFlags

func (f *Flags) SetFlags(pflag *pflag.FlagSet)

type Funcs

type Funcs map[string]int

func GetFuncs

func GetFuncs(pattern, filterStruct, modelBTF string, spec *btf.Spec, kmods []string, kprobeMulti bool) (funcs Funcs, err error)

func MergerFunList

func MergerFunList(funList1, funList2 Funcs) Funcs

func SplitCustomFunList

func SplitCustomFunList(funList string) (addFuncs Funcs)

func (Funcs) ToString

func (f Funcs) ToString()

type Kprobe

type Kprobe struct {
	HookFuncs []string
	Prog      *ebpf.Program
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL