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

cpu

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPU

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

func NewCPUProfiler

func NewCPUProfiler(
	logger log.Logger,
	reg prometheus.Registerer,
	processInfoManager profiler.ProcessInfoManager,
	compilerInfoManager *runtime.CompilerInfoManager,
	profileConverter *pprof.Manager,
	profileWriter profiler.ProfileStore,
	config *Config,
	bpfProgramLoaded chan bool,
	objFilePool *objectfile.Pool,
	cpus cpuinfo.CPUSet,
	finder *debuginfo.Finder,
) *CPU

func (*CPU) FailedReasons added in v0.31.0

func (p *CPU) FailedReasons() map[int]profiler.UnwindFailedReasons

FailedReasons gets a map of PID to reasons unwinding failed for that PID during the current profiling loop.

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 {
	ProfilingDuration          time.Duration
	ProfilingSamplingFrequency uint64

	PerfEventBufferPollInterval       time.Duration
	PerfEventBufferProcessingInterval time.Duration
	PerfEventBufferWorkerCount        int

	MemlockRlimit uint64

	DebugProcessNames []string

	DWARFUnwindingDisabled         bool
	DWARFUnwindingMixedModeEnabled bool
	BPFVerboseLoggingEnabled       bool
	BPFEventsBufferSize            uint32

	PythonUnwindingEnabled bool
	RubyUnwindingEnabled   bool
	JavaUnwindingEnabled   bool

	RateLimitUnwindInfo         uint32
	RateLimitProcessMappings    uint32
	RateLimitRefreshProcessInfo uint32
	RateLimitRead               uint32

	CollectCustomLabels bool
}

func (Config) DebugModeEnabled added in v0.24.0

func (c Config) DebugModeEnabled() bool

type PidEventPayload added in v0.31.0

type PidEventPayload struct {
	Type                         uint8
	Padding1, Padding2, Padding3 uint8
	Pid                          int32
}

type RequestReadPayload added in v0.31.0

type RequestReadPayload struct {
	Type                         uint8
	Padding1, Padding2, Padding3 uint8
	Pid                          int32
	Addr                         uint64
}

type UnwinderConfig added in v0.24.0

type UnwinderConfig struct {
	FilterProcesses             bool
	VerboseLogging              bool
	MixedStackWalking           bool
	PythonEnable                bool
	RubyEnabled                 bool
	JavaEnabled                 bool
	CollectCustomLabels         bool
	Padding                     bool
	RateLimitUnwindInfo         uint32
	RateLimitProcessMappings    uint32
	RateLimitRefreshProcessInfo uint32
	RateLimitRead               uint32
}

UnwinderConfig must be synced to the C definition.

Directories

Path Synopsis
bpf

Jump to

Keyboard shortcuts

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