metastore

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLocationNotFound = errors.New("location not found")
	ErrMappingNotFound  = errors.New("mapping not found")
	ErrFunctionNotFound = errors.New("function not found")
)

Functions

This section is empty.

Types

type Function added in v0.4.0

type Function struct {
	ID uuid.UUID
	FunctionKey
}

type FunctionKey

type FunctionKey struct {
	StartLine                  int64
	Name, SystemName, Filename string
}

func MakeFunctionKey

func MakeFunctionKey(f *Function) FunctionKey

type FunctionStore

type FunctionStore interface {
	GetFunctionByKey(ctx context.Context, key FunctionKey) (*Function, error)
	CreateFunction(ctx context.Context, f *Function) (uuid.UUID, error)
}

type InMemorySQLiteMetaStore

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

func NewInMemorySQLiteProfileMetaStore

func NewInMemorySQLiteProfileMetaStore(
	reg prometheus.Registerer,
	tracer trace.Tracer,
	name ...string,
) (*InMemorySQLiteMetaStore, error)

func (InMemorySQLiteMetaStore) Close

func (s InMemorySQLiteMetaStore) Close() error

func (InMemorySQLiteMetaStore) CreateFunction

func (s InMemorySQLiteMetaStore) CreateFunction(ctx context.Context, fn *Function) (uuid.UUID, error)

func (InMemorySQLiteMetaStore) CreateLocation

func (s InMemorySQLiteMetaStore) CreateLocation(ctx context.Context, l *Location) (uuid.UUID, error)

func (InMemorySQLiteMetaStore) CreateMapping

func (s InMemorySQLiteMetaStore) CreateMapping(ctx context.Context, m *Mapping) (uuid.UUID, error)

func (InMemorySQLiteMetaStore) GetFunctionByKey

func (s InMemorySQLiteMetaStore) GetFunctionByKey(ctx context.Context, k FunctionKey) (*Function, error)

func (InMemorySQLiteMetaStore) GetFunctions

func (s InMemorySQLiteMetaStore) GetFunctions(ctx context.Context) ([]*Function, error)

func (InMemorySQLiteMetaStore) GetLocationByKey

func (s InMemorySQLiteMetaStore) GetLocationByKey(ctx context.Context, k LocationKey) (*Location, error)

func (InMemorySQLiteMetaStore) GetLocations

func (s InMemorySQLiteMetaStore) GetLocations(ctx context.Context) ([]*Location, error)

func (InMemorySQLiteMetaStore) GetLocationsByIDs

func (s InMemorySQLiteMetaStore) GetLocationsByIDs(ctx context.Context, ids ...uuid.UUID) (
	map[uuid.UUID]*Location,
	error,
)

func (InMemorySQLiteMetaStore) GetMappingByKey

func (s InMemorySQLiteMetaStore) GetMappingByKey(ctx context.Context, k MappingKey) (*Mapping, error)

func (InMemorySQLiteMetaStore) GetMappingsByIDs

func (s InMemorySQLiteMetaStore) GetMappingsByIDs(ctx context.Context, ids ...uuid.UUID) (map[uuid.UUID]*Mapping, error)

func (InMemorySQLiteMetaStore) GetSymbolizableLocations

func (s InMemorySQLiteMetaStore) GetSymbolizableLocations(ctx context.Context) ([]*Location, error)

func (InMemorySQLiteMetaStore) Ping

func (s InMemorySQLiteMetaStore) Ping() error

func (InMemorySQLiteMetaStore) Symbolize

func (s InMemorySQLiteMetaStore) Symbolize(ctx context.Context, l *Location) error

type Line added in v0.4.0

type Line struct {
	FunctionID uuid.UUID
	Line       int64
}

type Location

type Location struct {
	ID       uuid.UUID
	Address  uint64
	Mapping  *Mapping
	Lines    []LocationLine
	IsFolded bool
}

type LocationKey

type LocationKey struct {
	NormalizedAddress uint64
	MappingID         uuid.UUID
	Lines             string
	IsFolded          bool
}

func MakeLocationKey

func MakeLocationKey(l *Location) LocationKey

type LocationLine added in v0.4.0

type LocationLine struct {
	Line     int64
	Function *Function
}

type LocationStore

type LocationStore interface {
	GetLocationByKey(ctx context.Context, k LocationKey) (*Location, error)
	GetLocationsByIDs(ctx context.Context, id ...uuid.UUID) (map[uuid.UUID]*Location, error)
	CreateLocation(ctx context.Context, l *Location) (uuid.UUID, error)
	Symbolize(ctx context.Context, location *Location) error
	GetSymbolizableLocations(ctx context.Context) ([]*Location, error)
}

type Mapping added in v0.4.0

type Mapping struct {
	ID              uuid.UUID
	Start           uint64
	Limit           uint64
	Offset          uint64
	File            string
	BuildID         string
	HasFunctions    bool
	HasFilenames    bool
	HasLineNumbers  bool
	HasInlineFrames bool
}

func (*Mapping) Unsymbolizable added in v0.4.0

func (m *Mapping) Unsymbolizable() bool

Unsymbolizable returns true if a mapping points to a binary for which locations can't be symbolized in principle, at least now. Examples are "[vdso]", [vsyscall]" and some others, see the code.

type MappingKey

type MappingKey struct {
	Size, Offset  uint64
	BuildIDOrFile string
}

func MakeMappingKey

func MakeMappingKey(m *Mapping) MappingKey

type MappingStore

type MappingStore interface {
	GetMappingByKey(ctx context.Context, key MappingKey) (*Mapping, error)
	CreateMapping(ctx context.Context, m *Mapping) (uuid.UUID, error)
}

type OnDiskSQLiteMetaStore

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

func NewDiskProfileMetaStore

func NewDiskProfileMetaStore(
	reg prometheus.Registerer,
	tracer trace.Tracer,
	path ...string,
) (*OnDiskSQLiteMetaStore, error)

func (OnDiskSQLiteMetaStore) Close

func (s OnDiskSQLiteMetaStore) Close() error

func (OnDiskSQLiteMetaStore) CreateFunction

func (s OnDiskSQLiteMetaStore) CreateFunction(ctx context.Context, fn *Function) (uuid.UUID, error)

func (OnDiskSQLiteMetaStore) CreateLocation

func (s OnDiskSQLiteMetaStore) CreateLocation(ctx context.Context, l *Location) (uuid.UUID, error)

func (OnDiskSQLiteMetaStore) CreateMapping

func (s OnDiskSQLiteMetaStore) CreateMapping(ctx context.Context, m *Mapping) (uuid.UUID, error)

func (OnDiskSQLiteMetaStore) GetFunctionByKey

func (s OnDiskSQLiteMetaStore) GetFunctionByKey(ctx context.Context, k FunctionKey) (*Function, error)

func (OnDiskSQLiteMetaStore) GetFunctions

func (s OnDiskSQLiteMetaStore) GetFunctions(ctx context.Context) ([]*Function, error)

func (OnDiskSQLiteMetaStore) GetLocationByKey

func (s OnDiskSQLiteMetaStore) GetLocationByKey(ctx context.Context, k LocationKey) (*Location, error)

func (OnDiskSQLiteMetaStore) GetLocations

func (s OnDiskSQLiteMetaStore) GetLocations(ctx context.Context) ([]*Location, error)

func (OnDiskSQLiteMetaStore) GetLocationsByIDs

func (s OnDiskSQLiteMetaStore) GetLocationsByIDs(ctx context.Context, ids ...uuid.UUID) (
	map[uuid.UUID]*Location,
	error,
)

func (OnDiskSQLiteMetaStore) GetMappingByKey

func (s OnDiskSQLiteMetaStore) GetMappingByKey(ctx context.Context, k MappingKey) (*Mapping, error)

func (OnDiskSQLiteMetaStore) GetMappingsByIDs

func (s OnDiskSQLiteMetaStore) GetMappingsByIDs(ctx context.Context, ids ...uuid.UUID) (map[uuid.UUID]*Mapping, error)

func (OnDiskSQLiteMetaStore) GetSymbolizableLocations

func (s OnDiskSQLiteMetaStore) GetSymbolizableLocations(ctx context.Context) ([]*Location, error)

func (OnDiskSQLiteMetaStore) Ping

func (s OnDiskSQLiteMetaStore) Ping() error

func (OnDiskSQLiteMetaStore) Symbolize

func (s OnDiskSQLiteMetaStore) Symbolize(ctx context.Context, l *Location) error

type ProfileMetaStore

type ProfileMetaStore interface {
	LocationStore
	FunctionStore
	MappingStore
	Close() error
	Ping() error
}

type RemoteMetaStore

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

func NewRemoteProfileMetaStore

func NewRemoteProfileMetaStore(addr string) (*RemoteMetaStore, error)

func (RemoteMetaStore) Close

func (s RemoteMetaStore) Close() error

func (RemoteMetaStore) CreateFunction

func (s RemoteMetaStore) CreateFunction(ctx context.Context, fn *Function) (uuid.UUID, error)

func (RemoteMetaStore) CreateLocation

func (s RemoteMetaStore) CreateLocation(ctx context.Context, l *Location) (uuid.UUID, error)

func (RemoteMetaStore) CreateMapping

func (s RemoteMetaStore) CreateMapping(ctx context.Context, m *Mapping) (uuid.UUID, error)

func (RemoteMetaStore) GetFunctionByKey

func (s RemoteMetaStore) GetFunctionByKey(ctx context.Context, k FunctionKey) (*Function, error)

func (RemoteMetaStore) GetFunctions

func (s RemoteMetaStore) GetFunctions(ctx context.Context) ([]*Function, error)

func (RemoteMetaStore) GetLocationByKey

func (s RemoteMetaStore) GetLocationByKey(ctx context.Context, k LocationKey) (*Location, error)

func (RemoteMetaStore) GetLocations

func (s RemoteMetaStore) GetLocations(ctx context.Context) ([]*Location, error)

func (RemoteMetaStore) GetLocationsByIDs

func (s RemoteMetaStore) GetLocationsByIDs(ctx context.Context, ids ...uuid.UUID) (
	map[uuid.UUID]*Location,
	error,
)

func (RemoteMetaStore) GetMappingByKey

func (s RemoteMetaStore) GetMappingByKey(ctx context.Context, k MappingKey) (*Mapping, error)

func (RemoteMetaStore) GetMappingsByIDs

func (s RemoteMetaStore) GetMappingsByIDs(ctx context.Context, ids ...uuid.UUID) (map[uuid.UUID]*Mapping, error)

func (RemoteMetaStore) GetSymbolizableLocations

func (s RemoteMetaStore) GetSymbolizableLocations(ctx context.Context) ([]*Location, error)

func (RemoteMetaStore) Ping

func (s RemoteMetaStore) Ping() error

func (RemoteMetaStore) Symbolize

func (s RemoteMetaStore) Symbolize(ctx context.Context, l *Location) error

type SerializedLocation added in v0.4.0

type SerializedLocation struct {
	ID                uuid.UUID
	Address           uint64
	NormalizedAddress uint64
	MappingID         uuid.UUID
	IsFolded          bool
}

Jump to

Keyboard shortcuts

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