Documentation ¶
Overview ¶
Package perf contains logic to interact with the linux perf subsystem. The open_perf_event syscall ABI and debugfs logic is large enough to warrant its own package so as to not clutter up the gobpfld package. The functionality in this package will be used to attach kprobe, tracepoint, perf event, raw tracepoint and trancing programs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Type bpfSyscall.PerfType // contains filtered or unexported fields }
Event represents an linux perf event in userspace.
func OpenKProbeEvent ¶
func OpenKProbeEvent(kprobeOpts KProbeOpts) (*Event, error)
func OpenTracepointEvent ¶
OpenTracepointEvent opens a perf event for an existing tracepoint. Tracepoint perf events can be used to to attach BPF_PROG_TYPE_TRACEPOINT applications to.
func OpenUProbeEvent ¶
func OpenUProbeEvent(uprobeOpts UProbeOpts) (*Event, error)
func (*Event) AttachBPFProgram ¶
AttachBPFProgram attach a loaded BPF program to the perf event.
func (*Event) DetachBPFProgram ¶
type KProbeOpts ¶
type KProbeOpts struct { Type ProbeType // Group name. If omitted, use "kprobes" for it. Group string // Event name. If omitted, the event name is generated // based on SYM+offs or MEMADDR. Event string // Module name which has given Symbol. Module string // Symbol+Offset where the probe is inserted. Symbol string }
type ProbeType ¶
type ProbeType int
const ( // TypeUnknown is the default value for the KProbeType TypeUnknown ProbeType = iota // TypeKProbe means a kprobe triggers on the beginning of a function/symbol TypeKProbe // TypeKRetprobe means a krprobe trigger on the end/return of a function/symbol TypeKRetprobe // TypeUProbe means a uprobe triggers on the beginning of a function/symbol TypeUProbe // TypeURetProbe means a uprobe trigger on the end/return of a function/symbol TypeURetProbe )
type UProbeOpts ¶
type UProbeOpts struct { Type ProbeType // Group name. If omitted, use "kprobes" for it. Group string // Event name. If omitted, the event name is generated // based on SYM+offs or MEMADDR. Event string // Path is the path to the executable to be probed. Path string // Offset of the address to be be probed. Offset int }
Click to show internal directories.
Click to hide internal directories.