Help us shape the future of Go! Take the 2026 Go Developer Survey

cpu

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2023 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestUnwindInformation = 1 << 63
	RequestProcessMappings   = 1 << 62
	RequestRefreshProcInfo   = 1 << 61
)

Variables

View Source
var (
	ErrNeedMoreProfilingRounds = errors.New("not enough profiling rounds with this unwind info")
)

Functions

func FdInfoMemlock added in v0.13.0

func FdInfoMemlock(logger log.Logger, data []byte) (int, error)

FDInfoMemlock returns the memory locked by the fd for a process using fdinfo data.

Types

type CPU

type CPU struct {
	// contains filtered or unexported fields
}

func NewCPUProfiler

func NewCPUProfiler(
	logger log.Logger,
	reg prometheus.Registerer,
	symbolizer profiler.Symbolizer,
	psMapCache profiler.ProcessMapCache,
	objFileCache profiler.ObjectFileCache,
	profileWriter profiler.ProfileWriter,
	debuginfoProcessor profiler.DebugInfoManager,
	labelsManager profiler.LabelsManager,
	profilingDuration time.Duration,
	profilingSamplingFrequency uint64,
	memlockRlimit uint64,
	debugProcessNames []string,
	enableNormalization bool,
	disableDWARFUnwinding bool,
	verboseBpfLogging bool,
	bpfProgramLoaded chan bool,
) *CPU

func (*CPU) LastError

func (p *CPU) LastError() error

func (*CPU) LastProfileStartedAt

func (p *CPU) LastProfileStartedAt() time.Time

func (*CPU) Name

func (p *CPU) Name() string

func (*CPU) ProcessLastErrors

func (p *CPU) ProcessLastErrors() map[int]error

func (*CPU) Run

func (p *CPU) Run(ctx context.Context) error

type Config

type Config struct {
	FilterProcesses bool
	VerboseLogging  bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL