Documentation ¶
Index ¶
- Constants
- func PerfBufferFunc(ctx unsafe.Pointer, cpu C.int, data unsafe.Pointer, size C.int)
- func PerfBufferLostFunc(ctx unsafe.Pointer, cpu C.int, cnt C.ulonglong)
- func RingBufferFunc(ctx unsafe.Pointer, data unsafe.Pointer, size C.int) C.int
- type BPFMap
- type BPFPinnedMap
- type BPFProgram
- type BaseProgram
- type KprobeProgram
- type MapFlag
- type Module
- func (m *Module) AddDeferFunc(function func())
- func (m *Module) AddElfFile(path string)
- func (m *Module) BPFLoadObject() error
- func (m *Module) Close()
- func (m *Module) GenerationProgram(bpfProgram *C.struct_bpf_program) Program
- func (m *Module) GetAllMapName() (res []string)
- func (m *Module) GetAllProgram() map[string]Program
- func (m *Module) LoadAllIntoKernel() error
- func (m *Module) LoadAllMap() error
- func (m *Module) LoadAllProgram() error
- func (m *Module) LoadPinnedMapFromPath(name string)
- func (m *Module) NewPerfBuffer(mapName string) *C.struct_perf_buffer
- func (m *Module) PerfStart(mapName string)
- func (m *Module) PerfStop(mapName string)
- type PerfEvent
- type Program
- type TCProgram
- type TracePointProgram
- type UProbeProgram
- type XDPProgram
Constants ¶
View Source
const ( TracePoint = "tracepoint" KProbe = "kprobe" KRetProbe = "kretprobe" UProbe = "uprobe" URetProbe = "uretprobe" XDP = "xdp" TC = "tc" LSM = "lsm" )
View Source
const ( BPF_MAP_TYPE_UNSPEC = iota BPF_MAP_TYPE_HASH BPF_MAP_TYPE_ARRAY BPF_MAP_TYPE_PROG_ARRAY BPF_MAP_TYPE_PERF_EVENT_ARRAY BPF_MAP_TYPE_PERCPU_HASH BPF_MAP_TYPE_PERCPU_ARRAY BPF_MAP_TYPE_STACK_TRACE BPF_MAP_TYPE_CGROUP_ARRAY BPF_MAP_TYPE_LRU_HASH BPF_MAP_TYPE_LRU_PERCPU_HASH BPF_MAP_TYPE_LPM_TRIE BPF_MAP_TYPE_ARRAY_OF_MAPS BPF_MAP_TYPE_HASH_OF_MAPS BPF_MAP_TYPE_DEVMAP BPF_MAP_TYPE_SOCKMAP BPF_MAP_TYPE_CPUMAP BPF_MAP_TYPE_XSKMAP BPF_MAP_TYPE_SOCKHASH BPF_MAP_TYPE_CGROUP_STORAGE BPF_MAP_TYPE_REUSEPORT_SOCKARRAY BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE BPF_MAP_TYPE_QUEUE BPF_MAP_TYPE_STACK BPF_MAP_TYPE_SK_STORAGE BPF_MAP_TYPE_DEVMAP_HASH BPF_MAP_TYPE_STRUCT_OPS BPF_MAP_TYPE_RINGBUF BPF_MAP_TYPE_INODE_STORAGE BPF_MAP_TYPE_TASK_STORAGE BPF_MAP_TYPE_BLOOM_FILTER )
View Source
const (
PinnedFilePath = "/sys/fs/bpf/"
)
Variables ¶
This section is empty.
Functions ¶
func PerfBufferFunc ¶
Types ¶
type BPFPinnedMap ¶
type BPFPinnedMap struct {
// contains filtered or unexported fields
}
func (*BPFPinnedMap) MapDelElem ¶
func (m *BPFPinnedMap) MapDelElem(key unsafe.Pointer) error
func (*BPFPinnedMap) MapLookupElem ¶
func (m *BPFPinnedMap) MapLookupElem(key unsafe.Pointer) []byte
func (*BPFPinnedMap) MapUpdateElem ¶
func (m *BPFPinnedMap) MapUpdateElem(key, value unsafe.Pointer)
type BPFProgram ¶
type BPFProgram struct {
// contains filtered or unexported fields
}
type BaseProgram ¶
type BaseProgram struct {
// contains filtered or unexported fields
}
func (BaseProgram) GetProgramSecName ¶
func (p BaseProgram) GetProgramSecName() string
type KprobeProgram ¶
type KprobeProgram struct {
BaseProgram
}
func (*KprobeProgram) LoadIntoKernel ¶
func (t *KprobeProgram) LoadIntoKernel() error
func (*KprobeProgram) Unload ¶
func (t *KprobeProgram) Unload() error
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func NewModuleFromFile ¶
func (*Module) AddDeferFunc ¶
func (m *Module) AddDeferFunc(function func())
func (*Module) AddElfFile ¶
func (*Module) BPFLoadObject ¶
func (*Module) GenerationProgram ¶
func (m *Module) GenerationProgram(bpfProgram *C.struct_bpf_program) Program
func (*Module) GetAllMapName ¶
func (*Module) GetAllProgram ¶
func (*Module) LoadAllIntoKernel ¶
func (*Module) LoadAllMap ¶
func (*Module) LoadAllProgram ¶
func (*Module) LoadPinnedMapFromPath ¶
func (*Module) NewPerfBuffer ¶
func (m *Module) NewPerfBuffer(mapName string) *C.struct_perf_buffer
type PerfEvent ¶ added in v0.0.4
type PerfEvent struct {
// contains filtered or unexported fields
}
type TracePointProgram ¶
type TracePointProgram struct { BaseProgram // contains filtered or unexported fields }
func (*TracePointProgram) LoadIntoKernel ¶
func (t *TracePointProgram) LoadIntoKernel() error
func (*TracePointProgram) Unload ¶
func (t *TracePointProgram) Unload() error
type UProbeProgram ¶
type UProbeProgram struct { BaseProgram // contains filtered or unexported fields }
func (*UProbeProgram) AddOffset ¶
func (t *UProbeProgram) AddOffset(offset string) error
func (*UProbeProgram) AddOffsetByFuncName ¶
func (t *UProbeProgram) AddOffsetByFuncName(funcName string) error
func (*UProbeProgram) LoadIntoKernel ¶
func (t *UProbeProgram) LoadIntoKernel() error
func (*UProbeProgram) Unload ¶
func (t *UProbeProgram) Unload() error
type XDPProgram ¶
type XDPProgram struct {
BaseProgram
}
func (*XDPProgram) LoadIntoKernel ¶
func (t *XDPProgram) LoadIntoKernel() error
func (*XDPProgram) Unload ¶
func (t *XDPProgram) Unload() error
Click to show internal directories.
Click to hide internal directories.