Documentation ¶
Index ¶
- Constants
- type Entry
- type Module
- func (bpf *Module) AttachKprobe(fnName string, fd int) error
- func (bpf *Module) AttachKretprobe(fnName string, fd int) error
- func (bpf *Module) AttachMatchingUprobes(name, match string, fd, pid int) error
- func (bpf *Module) AttachMatchingUretprobes(name, match string, fd, pid int) error
- func (bpf *Module) AttachUprobe(name, symbol string, fd, pid int) error
- func (bpf *Module) AttachUretprobe(name, symbol string, fd, pid int) error
- func (bpf *Module) AttachXDP(devName string, fd int) error
- func (bpf *Module) Close()
- func (bpf *Module) Load(name string, progType int) (int, error)
- func (bpf *Module) LoadKprobe(name string) (int, error)
- func (bpf *Module) LoadNet(name string) (int, error)
- func (bpf *Module) LoadUprobe(name string) (int, error)
- func (bpf *Module) RemoveXDP(devName string) error
- func (bpf *Module) TableDesc(id uint64) map[string]interface{}
- func (bpf *Module) TableId(name string) C.size_t
- func (bpf *Module) TableIter() <-chan map[string]interface{}
- func (bpf *Module) TableSize() uint64
- type PerfMap
- type Table
- func (table *Table) Config() map[string]interface{}
- func (table *Table) Delete(keyStr string) error
- func (table *Table) DeleteRaw(_key []byte) error
- func (table *Table) Get(keyStr string) (interface{}, bool)
- func (table *Table) GetRaw(_key []byte) ([]byte, bool)
- func (table *Table) ID() string
- func (table *Table) Iter() <-chan Entry
- func (table *Table) Name() string
- func (table *Table) Set(keyStr, leafStr string) error
- func (table *Table) SetRaw(_key, _leaf []byte) error
Constants ¶
const ( BPF_PROBE_ENTRY = iota BPF_PROBE_RETURN )
const BPF_PERF_READER_PAGE_CNT = 8
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module type
func NewModule ¶
NewModule asynchronously compiles the code, generates a new BPF module and returns it.
func (*Module) AttachKprobe ¶
AttachKprobe attaches a kprobe fd to a function.
func (*Module) AttachKretprobe ¶
AttachKretprobe attaches a kretprobe fd to a function.
func (*Module) AttachMatchingUprobes ¶
AttachMatchingUprobes attaches a uprobe fd to all symbols in the library or binary 'name' that match a given pattern. The 'name' argument can be given as either a full library path (/usr/lib/..), a library without the lib prefix, or as a binary with full path (/bin/bash) A pid can be given, or -1 to attach to all processes
Presently attempts to trace processes running in a different namespace to the tracer will fail due to limitations around namespace-switching in multi-threaded programs (such as Go programs)
func (*Module) AttachMatchingUretprobes ¶
AttachMatchingUretprobes attaches a uretprobe fd to all symbols in the library or binary 'name' that match a given pattern. The 'name' argument can be given as either a full library path (/usr/lib/..), a library without the lib prefix, or as a binary with full path (/bin/bash) A pid can be given, or -1 to attach to all processes
Presently attempts to trace processes running in a different namespace to the tracer will fail due to limitations around namespace-switching in multi-threaded programs (such as Go programs)
func (*Module) AttachUprobe ¶
AttachUprobe attaches a uprobe fd to the symbol in the library or binary 'name' The 'name' argument can be given as either a full library path (/usr/lib/..), a library without the lib prefix, or as a binary with full path (/bin/bash) A pid can be given to attach to, or -1 to attach to all processes
Presently attempts to trace processes running in a different namespace to the tracer will fail due to limitations around namespace-switching in multi-threaded programs (such as Go programs)
func (*Module) AttachUretprobe ¶
AttachUretprobe attaches a uretprobe fd to the symbol in the library or binary 'name' The 'name' argument can be given as either a full library path (/usr/lib/..), a library without the lib prefix, or as a binary with full path (/bin/bash) A pid can be given to attach to, or -1 to attach to all processes
Presently attempts to trace processes running in a different namespace to the tracer will fail due to limitations around namespace-switching in multi-threaded programs (such as Go programs)
func (*Module) Close ¶
func (bpf *Module) Close()
Close takes care of closing all kprobes opened by this modules and destroys the underlying libbpf module.
func (*Module) LoadKprobe ¶
LoadKprobe loads a program of type BPF_PROG_TYPE_KPROBE.
func (*Module) LoadUprobe ¶
LoadUprobe loads a program of type BPF_PROG_TYPE_KPROBE.
type PerfMap ¶
type PerfMap struct {
// contains filtered or unexported fields
}
func InitPerfMap ¶
InitPerfMap initializes a perf map with a receiver channel.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}