debuginfo

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Copyright 2022-2023 The Parca Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache added in v0.20.0

type Cache[K comparable, V any] interface {
	Add(K, V)
	Get(K) (V, bool)
	Purge()
	Close() error
}

type Extractor

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

Extractor extracts debug information from a binary.

func NewExtractor

func NewExtractor(logger log.Logger, tracer trace.Tracer) *Extractor

NewExtractor creates a new Extractor.

func (*Extractor) Extract

func (e *Extractor) Extract(ctx context.Context, dst io.WriteSeeker, src SeekReaderAt) error

Extract extracts debug information from the given executable. Cleaning up the temporary directory and the interim file is the caller's responsibility.

func (*Extractor) ExtractAll added in v0.6.0

func (e *Extractor) ExtractAll(ctx context.Context, srcDsts map[string]io.WriteSeeker) error

ExtractAll extracts debug information from the given executables. It consumes a map of file sources to extract and a destination io.Writer.

type Finder added in v0.6.0

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

Finder finds the separate debug information files on the system.

func NewFinder added in v0.6.0

func NewFinder(logger log.Logger, tracer trace.Tracer, reg prometheus.Registerer, debugDirs []string) *Finder

NewFinder creates a new Finder.

func (*Finder) Close added in v0.20.0

func (f *Finder) Close() error

func (*Finder) Find added in v0.6.0

func (f *Finder) Find(ctx context.Context, root string, obj *objectfile.ObjectFile) (string, error)

Find finds the separate debug file for the given object file.

type Manager added in v0.10.0

type Manager struct {
	*Extractor
	*Finder
	// contains filtered or unexported fields
}

Manager is a mechanism for extracting or finding the relevant debug information for the discovered executables.

func New added in v0.6.0

func New(
	logger log.Logger,
	tracer trace.Tracer,
	reg prometheus.Registerer,
	objFilePool *objectfile.Pool,
	debuginfoClient debuginfopb.DebuginfoServiceClient,
	uploadMaxParallel int,
	uploadTimeout time.Duration,
	cachingDisabled bool,
	debugDirs []string,
	stripDebuginfos bool,
	tempDir string,
) *Manager

New creates a new Manager.

func (*Manager) Close added in v0.20.0

func (di *Manager) Close() error

func (*Manager) Extract added in v0.20.0

func (*Manager) ExtractOrFind added in v0.20.0

func (di *Manager) ExtractOrFind(ctx context.Context, root string, src *objectfile.ObjectFile) (*objectfile.ObjectFile, error)

ExtractOrFind extracts or finds the debug information for the given object file. And sets the debuginfo file pointer to the debuginfo object file.

func (*Manager) ShouldInitiateUpload added in v0.20.0

func (di *Manager) ShouldInitiateUpload(ctx context.Context, buildID string) (_ bool, err error)

ShouldInitiateUpload checks whether the debuginfo file associated with the given buildID should be uploaded. If the buildID is already in the cache, there is no need to extract, find or upload the debuginfo file.

func (*Manager) Upload added in v0.20.0

func (di *Manager) Upload(ctx context.Context, dbg *objectfile.ObjectFile) (err error)

func (*Manager) UploadMapping added in v0.20.0

func (di *Manager) UploadMapping(ctx context.Context, m *process.Mapping) (err error)

UploadMapping uploads that the debuginfo file associated (found or extracted) with the given mapping has been uploaded to the server. If the debuginfo file has not been uploaded yet, it will be uploaded.

type NoopClient

type NoopClient struct{}

func NewNoopClient

func NewNoopClient() *NoopClient

func (*NoopClient) InitiateUpload added in v0.11.0

func (*NoopClient) MarkUploadFinished added in v0.11.0

func (*NoopClient) ShouldInitiateUpload added in v0.11.0

func (*NoopClient) Upload

type NoopDebuginfoManager added in v0.20.0

type NoopDebuginfoManager struct{}

func (NoopDebuginfoManager) Close added in v0.20.0

func (NoopDebuginfoManager) Close() error

func (NoopDebuginfoManager) ExtractOrFind added in v0.20.0

func (NoopDebuginfoManager) ShouldInitiateUpload added in v0.20.0

func (NoopDebuginfoManager) ShouldInitiateUpload(ctx context.Context, buildID string) (bool, error)

func (NoopDebuginfoManager) Upload added in v0.20.0

func (NoopDebuginfoManager) UploadMapping added in v0.20.0

func (NoopDebuginfoManager) UploadMapping(ctx context.Context, m *process.Mapping) error

type SeekReaderAt added in v0.20.0

type SeekReaderAt interface {
	io.ReaderAt
	io.Seeker
}

Jump to

Keyboard shortcuts

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