profiler

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BumpMemlock added in v0.10.0

func BumpMemlock(cur, max uint64) (syscall.Rlimit, error)

BumpMemlock increases the current memlock limit to a value more reasonable for the profiler's needs.

func ConvertToPprof added in v0.10.0

func ConvertToPprof(captureTime time.Time, prs ...*Profile) (*profile.Profile, error)

ConvertToPprof converts several per process Profile to a pprof Profile.

func HumanizeRLimit added in v0.10.1

func HumanizeRLimit(val uint64) string

Types

type DebugInfoManager added in v0.10.0

type DebugInfoManager interface {
	EnsureUploaded(ctx context.Context, objFiles []*objectfile.MappedObjectFile)
}

type FileProfileWriter added in v0.10.0

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

FileProfileWriter writes profiles to a local file.

func NewFileProfileWriter added in v0.10.0

func NewFileProfileWriter(dirPath string) *FileProfileWriter

NewFileProfileWriter creates a new FileProfileWriter.

func (*FileProfileWriter) Write added in v0.10.0

func (fw *FileProfileWriter) Write(_ context.Context, labels model.LabelSet, prof *profile.Profile) error

type LabelsManager added in v0.10.0

type LabelsManager interface {
	LabelSet(name string, pid uint64) model.LabelSet
}

type NoopProfiler added in v0.10.0

type NoopProfiler struct{}

NoopProfiler does nothing. It serves as a skeleton of what other will have to be implemented when adding a new profiler.

func (*NoopProfiler) LastError added in v0.10.0

func (p *NoopProfiler) LastError() error

func (*NoopProfiler) LastProfileStartedAt added in v0.10.0

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

func (*NoopProfiler) Name added in v0.10.0

func (p *NoopProfiler) Name() string

func (*NoopProfiler) ProcessLastErrors added in v0.10.0

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

func (*NoopProfiler) Run added in v0.10.0

func (p *NoopProfiler) Run(_ context.Context) error

func (*NoopProfiler) Stop added in v0.10.0

func (p *NoopProfiler) Stop()

type Normalizer added in v0.10.0

type Normalizer interface {
	Normalize(pid int, m *profile.Mapping, addr uint64) uint64
}

type ObjectFileCache added in v0.10.0

type ObjectFileCache interface {
	ObjectFileForProcess(pid int, m *profile.Mapping) (*objectfile.MappedObjectFile, error)
}

type PID added in v0.10.0

type PID int32

PID is the process ID of the profiling target. See https://ftp.gnu.org/old-gnu/Manuals/glibc-2.2.3/html_node/libc_554.html

type ProcessMapCache added in v0.10.0

type ProcessMapCache interface {
	MappingForPID(pid int) ([]*profile.Mapping, error)
}

type Profile added in v0.10.0

type Profile struct {
	ID StackID

	Samples   []*profile.Sample
	Locations []*profile.Location

	UserLocations   []*profile.Location
	KernelLocations []*profile.Location

	UserMappings  []*profile.Mapping
	KernelMapping *profile.Mapping

	// Only available after symbolization.
	Functions []*profile.Function
}

Profile represents a capture profile of a process.

type ProfileWriter added in v0.10.0

type ProfileWriter interface {
	Write(ctx context.Context, labels model.LabelSet, prof *profile.Profile) error
}

type RemoteProfileWriter added in v0.10.0

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

RemoteProfileWriter is a profile writer that writes profiles to a remote profile store.

func NewRemoteProfileWriter added in v0.10.0

func NewRemoteProfileWriter(profileStoreClient profilestorepb.ProfileStoreServiceClient) *RemoteProfileWriter

NewRemoteProfileWriter creates a new RemoteProfileWriter.

func (*RemoteProfileWriter) Write added in v0.10.0

func (rw *RemoteProfileWriter) Write(ctx context.Context, labels model.LabelSet, prof *profile.Profile) error

Write sends the profile using the designated write client.

type StackID added in v0.10.0

type StackID struct {
	PID  PID
	TGID PID
}

StackID consists of two parts: the first part is the process ID of the profiling target, the second part is the thread ID of the stack trace has been collected from.

type Symbolizer added in v0.10.0

type Symbolizer interface {
	Symbolize(prof *Profile) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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