runtime

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFromProcessMemory added in v0.30.0

func CopyFromProcessMemory(pid int, addr uintptr, buf []byte) error

func FindSymbol added in v0.24.0

func FindSymbol(ef *elf.File, symbol string) (*elf.Symbol, error)

FindSymbol finds symbol by name in the given elf file.

func FindSymbolRegex added in v0.30.0

func FindSymbolRegex(ef *elf.File, rawRegexSymbolMatcher string) (*elf.Symbol, error)

FindSymbolRegex finds symbol by name in the given elf file using regex.

func HasSymbols added in v0.27.0

func HasSymbols(ef *elf.File, matches [][]byte) (bool, error)

func IsSymbolNameInDynamicSymbols added in v0.23.3

func IsSymbolNameInDynamicSymbols(f *elf.File, matches [][]byte) (bool, error)

ForEachElfSymbolNameInSymbols iterates over the symbols in the dynamic symbol table of the given elf file. It calls the given function for each symbol name. The value is only valid for the iteration, it must not be saved unless copied.

func IsSymbolNameInSymbols added in v0.23.3

func IsSymbolNameInSymbols(f *elf.File, matches [][]byte) (bool, error)

ForEachElfSymbolNameInSymbols iterates over the symbols in the symbol table of the given elf file. It calls the given function for each symbol name. The value is only valid for the iteration, it must not be saved unless copied.

func ReadStringAtAddress added in v0.24.0

func ReadStringAtAddress(rs io.ReadSeeker, address, size uint64) (string, error)

ReadStringAtAddress reads a null-terminated string from the given address in the given elf file.

func ScanPathForVersion added in v0.30.0

func ScanPathForVersion(path string, rgx *regexp.Regexp) (string, error)

func ScanReaderForVersion added in v0.30.0

func ScanReaderForVersion(r io.ReadSeeker, rgx *regexp.Regexp) (string, error)

func ScanRodataForVersion added in v0.30.0

func ScanRodataForVersion(r io.ReaderAt, rgx *regexp.Regexp) (string, error)

Types

type Compiler added in v0.28.0

type Compiler struct {
	Runtime

	Type     string
	BuildID  string
	Stripped bool
	Static   bool
}

type CompilerInfoManager added in v0.28.0

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

CompilerInfoManager is a cache for compiler information. Fetching this information is expensive, so we cache it. The cache is safe for concurrent use. It also controls throughput of fetches.

func NewCompilerInfoManager added in v0.28.0

func NewCompilerInfoManager(logger log.Logger, reg prometheus.Registerer, objFilePool *objectfile.Pool) *CompilerInfoManager

func (*CompilerInfoManager) Fetch added in v0.28.0

func (c *CompilerInfoManager) Fetch(path string) (*Compiler, error)

type IOVec added in v0.30.0

type IOVec struct {
	Base *byte
	Len  uint64
}

type Interpreter added in v0.24.0

type Interpreter struct {
	Runtime
	Type InterpreterType

	LibcInfo *libc.LibcInfo

	// The address of the main thread state for interpreters.
	MainThreadAddress  uint64
	InterpreterAddress uint64
	TLSKey             uint64
}

type InterpreterType added in v0.24.0

type InterpreterType uint64
const (
	InterpreterNone InterpreterType = iota
	InterpreterRuby
	InterpreterPython
)

func (InterpreterType) String added in v0.24.0

func (it InterpreterType) String() string

type ProcessMappedFile added in v0.30.0

type ProcessMappedFile struct {
	*os.File
	// contains filtered or unexported fields
}

func NewProcessMappedFile added in v0.30.0

func NewProcessMappedFile(pid int, f *os.File, start uint64) (*ProcessMappedFile, error)

func (ProcessMappedFile) Close added in v0.30.0

func (pmf ProcessMappedFile) Close() error

func (ProcessMappedFile) FindAddressOf added in v0.30.0

func (pmf ProcessMappedFile) FindAddressOf(s string) (uint64, error)

func (ProcessMappedFile) VersionFromBSS added in v0.30.0

func (pmf ProcessMappedFile) VersionFromBSS(rgx *regexp.Regexp) (string, error)

func (ProcessMappedFile) VersionFromRodata added in v0.30.0

func (pmf ProcessMappedFile) VersionFromRodata(rgx *regexp.Regexp) (string, error)

type Runtime added in v0.28.0

type Runtime struct {
	Name          RuntimeName
	Version       string
	VersionSource VersionSource
}

type RuntimeName added in v0.28.0

type RuntimeName string

type VersionSource added in v0.30.0

type VersionSource string
const (
	VersionSourcePath   VersionSource = "path"
	VersionSourceMemory VersionSource = "memory"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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