process

package
v0.12.0-alpha Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ExePathEnvVar = "OTEL_GO_AUTO_TARGET_EXE"

ExePathEnvVar is the environment variable key whose value points to the instrumented executable.

Variables

View Source
var (
	// ErrInterrupted is returned when a process was interrupted but didn't
	// fail in any other way.
	ErrInterrupted = errors.New("interrupted")

	// ErrProcessNotFound is returned when a requested process is not currently
	// running.
	ErrProcessNotFound = errors.New("process not found")
)

Functions

This section is empty.

Types

type AllocationDetails

type AllocationDetails struct {
	StartAddr uint64
	EndAddr   uint64
	NumCPU    uint64
}

AllocationDetails are the details about allocated memory.

func Allocate

func Allocate(logger logr.Logger, pid int) (*AllocationDetails, error)

Allocate allocates memory for the instrumented process.

type Analyzer

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

Analyzer is used to find actively running processes.

func NewAnalyzer

func NewAnalyzer(logger logr.Logger) *Analyzer

NewAnalyzer returns a new [ProcessAnalyzer].

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(pid int, relevantFuncs map[string]interface{}) (*TargetDetails, error)

Analyze returns the target details for an actively running process.

func (*Analyzer) DiscoverProcessID

func (a *Analyzer) DiscoverProcessID(ctx context.Context, target *TargetArgs) (int, error)

DiscoverProcessID searches for the target as an actively running process, returning its PID if found.

type TargetArgs

type TargetArgs struct {
	ExePath string
	Pid     int
}

TargetArgs are the binary target information.

func (*TargetArgs) Validate

func (t *TargetArgs) Validate() error

Validate validates t and returns an error if not valid.

type TargetDetails

type TargetDetails struct {
	PID               int
	Functions         []*binary.Func
	GoVersion         *version.Version
	Libraries         map[string]*version.Version
	AllocationDetails *AllocationDetails
}

TargetDetails are the details about a target function.

func (*TargetDetails) GetFunctionOffset

func (t *TargetDetails) GetFunctionOffset(name string) (uint64, error)

GetFunctionOffset returns the offset for of the function with name.

func (*TargetDetails) GetFunctionReturns

func (t *TargetDetails) GetFunctionReturns(name string) ([]uint64, error)

GetFunctionReturns returns the return value of the call for the function with name.

func (*TargetDetails) IsRegistersABI

func (t *TargetDetails) IsRegistersABI() bool

IsRegistersABI returns if t is supported.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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