Documentation ¶
Overview ¶
Package tracer contains functionality for populating tracers.
Index ¶
- Constants
- func GetCurrentKernelVersion() (major, minor, patch uint32, err error)
- func ProbeBPFSyscall() error
- func ProbeTracepoint() error
- type Intervals
- type Tracer
- func (t *Tracer) AttachSchedMonitor() error
- func (t *Tracer) AttachTracer(sampleFreq int) error
- func (t *Tracer) Close()
- func (t *Tracer) ConvertTrace(trace *host.Trace) *libpf.Trace
- func (t *Tracer) EnableProfiling() error
- func (t *Tracer) StartMapMonitors(ctx context.Context, traceOutChan chan *host.Trace) error
- func (t *Tracer) StartPIDEventProcessor(ctx context.Context) error
- func (t *Tracer) StartProbabilisticProfiling(ctx context.Context, interval time.Duration, threshold uint)
- func (t *Tracer) SymbolizationComplete(traceCaptureKTime libpf.KTime)
Constants ¶
const ( // ProbabilisticThresholdMax defines the upper bound of the probabilistic profiling // threshold. ProbabilisticThresholdMax = 100 )
Variables ¶
This section is empty.
Functions ¶
func GetCurrentKernelVersion ¶
GetCurrentKernelVersion returns the major, minor and patch version of the kernel of the host from the utsname struct.
func ProbeBPFSyscall ¶
func ProbeBPFSyscall() error
ProbeBPFSyscall checks if the syscall EBPF is available on the system.
func ProbeTracepoint ¶
func ProbeTracepoint() error
ProbeTracepoint checks if tracepoints are available on the system, so we can attach our eBPF code there.
Types ¶
type Intervals ¶
type Intervals interface { MonitorInterval() time.Duration TracePollInterval() time.Duration PIDCleanupInterval() time.Duration }
Intervals is a subset of config.IntervalsAndTimers.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer provides an interface for loading and initializing the eBPF components as well as for monitoring the output maps for new traces and count updates.
func NewTracer ¶
func NewTracer(ctx context.Context, rep reporter.SymbolReporter, intervals Intervals, includeTracers []bool, filterErrorFrames bool) (*Tracer, error)
NewTracer loads eBPF code and map definitions from the ELF module at the configured path.
func (*Tracer) AttachSchedMonitor ¶
AttachSchedMonitor attaches a kprobe to the process scheduler. This hook detects the exit of a process and enables us to clean up data we associated with this process.
func (*Tracer) AttachTracer ¶
AttachTracer attaches the main tracer entry point to the perf interrupt events. The tracer entry point is always the native tracer. The native tracer will determine when to invoke the interpreter tracers based on address range information.
func (*Tracer) Close ¶
func (t *Tracer) Close()
Close provides functionality for Tracer to perform cleanup tasks. NOTE: Close may be called multiple times in succession.
func (*Tracer) EnableProfiling ¶
EnableProfiling enables the perf interrupt events with the attached eBPF programs.
func (*Tracer) StartMapMonitors ¶
StartMapMonitors starts goroutines for collecting metrics and monitoring eBPF maps for tracepoints, new traces, trace count updates and unknown PCs.
func (*Tracer) StartPIDEventProcessor ¶
StartPIDEventProcessor spawns a goroutine to process PID events.
func (*Tracer) StartProbabilisticProfiling ¶
func (t *Tracer) StartProbabilisticProfiling(ctx context.Context, interval time.Duration, threshold uint)
StartProbabilisticProfiling periodically runs probabilistic profiling.