symbolizer

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotValidElf = errors.New("not a valid ELF file")
	ErrNoDebuginfo = errors.New("no debug info found")
	ErrLinerFailed = errors.New("liner creation failed")
)

Functions

func CalculateBase added in v0.22.0

func CalculateBase(ei profile.ExecutableInfo, m profile.Mapping, addr uint64) (uint64, error)

Base determines the base address to subtract from virtual address to get symbol table address. For an executable, the base is 0. Otherwise, it's a shared library, and the base is the address where the mapping starts. The kernel needs special handling.

func NormalizeAddress added in v0.22.0

func NormalizeAddress(addr uint64, ei profile.ExecutableInfo, m profile.Mapping) (uint64, error)

Types

type BadgerCache added in v0.22.0

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

func NewBadgerCache added in v0.22.0

func NewBadgerCache(db *badger.DB) *BadgerCache

func (*BadgerCache) Get added in v0.22.0

func (c *BadgerCache) Get(ctx context.Context, buildID string, addr uint64) ([]profile.LocationLine, bool, error)

func (*BadgerCache) Set added in v0.22.0

func (c *BadgerCache) Set(ctx context.Context, buildID string, addr uint64, lines []profile.LocationLine) error

type DebuginfoFetcher added in v0.15.0

type DebuginfoFetcher interface {
	// Fetch ensures that the debug info for the given build ID is available on
	// a local filesystem and returns a path to it.
	FetchDebuginfo(ctx context.Context, dbginfo *debuginfopb.Debuginfo) (io.ReadCloser, error)
}

type DebuginfoMetadata added in v0.15.0

type DebuginfoMetadata interface {
	SetQuality(ctx context.Context, buildID string, typ debuginfopb.DebuginfoType, quality *debuginfopb.DebuginfoQuality) error
	Fetch(ctx context.Context, buildID string, typ debuginfopb.DebuginfoType) (*debuginfopb.Debuginfo, error)
}

type Option added in v0.15.0

type Option func(*Symbolizer)

func WithDemangleMode added in v0.15.0

func WithDemangleMode(mode string) Option

type SymbolizationRequest added in v0.22.0

type SymbolizationRequest struct {
	BuildID  string
	Mappings []SymbolizationRequestMappingAddrs
}

type SymbolizationRequestMappingAddrs added in v0.22.0

type SymbolizationRequestMappingAddrs struct {
	// This slice is used to store the symbolization result directly.
	Locations []*profile.Location
}

type Symbolizer

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

func New

func New(
	logger log.Logger,
	metadata DebuginfoMetadata,
	cache SymbolizerCache,
	debuginfo DebuginfoFetcher,
	tmpDir string,
	opts ...Option,
) *Symbolizer

func (*Symbolizer) Symbolize added in v0.13.0

func (s *Symbolizer) Symbolize(
	ctx context.Context,
	req SymbolizationRequest,
) error

type SymbolizerCache added in v0.22.0

type SymbolizerCache interface {
	Get(ctx context.Context, buildID string, addr uint64) ([]profile.LocationLine, bool, error)
	Set(ctx context.Context, buildID string, addr uint64, lines []profile.LocationLine) error
}

Jump to

Keyboard shortcuts

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