Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Profiler ¶
type Profiler struct {
// contains filtered or unexported fields
}
Profiler handles off-CPU profiling with stack traces
func NewProfiler ¶
func NewProfiler(pid int, systemWide bool, tags []string, labels map[string]string, sym symbolize.Symbolizer, kernelSym symbolize.KernelSymbolizer, kernelStacks bool) (*Profiler, error)
NewProfiler creates a new off-CPU profiler.
kernelStacks gates the BPF program's kernel-stack capture (set from cfg.KernelStacks). When false, kernel-stack capture is fully bypassed at sample time. The off-CPU FP profiler has no per-PID pid_config setter, so the gate lives entirely in the BPF program.
func (*Profiler) Close ¶
func (pr *Profiler) Close()
Close releases all resources associated with the profiler. The symbolizer is owned by the Agent; we do not close it here.
func (*Profiler) Collect ¶
Collect writes the profile to the provided writer (supports streaming). The output is gzip-compressed pprof data.
func (*Profiler) CollectAndWrite ¶
CollectAndWrite collects samples and writes the profile to the specified path. This is a convenience wrapper around Collect for file-based output.