trace

package
v0.0.0-...-4db5314 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HealthCheckSockPath = "/tmp/xcover.sock"
)

Variables

View Source
var (
	ErrNoFunctionSymbols = errors.New("no functions found")
	ErrNoOffsets         = errors.New("no function offsets found")
	ErrExePathEmpty      = errors.New("exe path is empty")
	ErrElfFileNil        = errors.New("elf file is nil")
)
View Source
var (
	ErrFuncNotFoundForCookie = errors.New("function not found for cookie")
	ErrBpfObjBufEmpty        = errors.New("BPF object buffer is empty")
	ErrBpfObjNameEmpty       = errors.New("BPF object name is empty")
	ErrTraceeNil             = errors.New("trace is nil")
	ErrTraceeExePathEmpty    = errors.New("tracee exe path is empty")
	ErrTraceeFuncListEmpty   = errors.New("tracee function list is empty")
)
View Source
var (
	ReportFileName = fmt.Sprintf("%s-report.json", settings.CmdName)
)

Functions

This section is empty.

Types

type Event

type Event struct {
	Cookie cookie
}

type FuncName

type FuncName struct {
	Name [funNameLen]byte
}

type FunctionEntry

type FunctionEntry struct {
	Name   string
	Offset uint64
}

FunctionEntry represents a function resolved from a binary, ready for uprobe attachment.

type FunctionResolver

type FunctionResolver func() ([]FunctionEntry, error)

FunctionResolver resolves the set of functions to trace from a binary. It is self-contained: it owns its own I/O and closes any resources it opens.

func SymbolTableResolver

func SymbolTableResolver(path string, logger log.Logger, include, exclude string, bindInclude, bindExclude []elf.SymBind) FunctionResolver

SymbolTableResolver returns a FunctionResolver backed by the ELF symbol table, with a .gopclntab fallback for stripped Go binaries. path is the binary to open; the resolver opens and closes it itself.

type UserTracee

type UserTracee struct {
	*UserTraceeOptions
	// contains filtered or unexported fields
}

func NewUserTracee

func NewUserTracee(opts ...UserTraceeOption) *UserTracee

func (*UserTracee) GetFuncCookies

func (t *UserTracee) GetFuncCookies() []uint64

func (*UserTracee) GetFuncNames

func (t *UserTracee) GetFuncNames() []string

func (*UserTracee) GetFuncOffsets

func (t *UserTracee) GetFuncOffsets() []uint64

func (*UserTracee) Init

func (t *UserTracee) Init() error

func (*UserTracee) ShouldIncludeSymbol

func (t *UserTracee) ShouldIncludeSymbol(sym elf.Symbol) bool

ShouldIncludeSymbol reports whether sym passes the tracee's include/exclude filters. Kept for backward compatibility; prefer the package-level shouldInclude for new code.

type UserTraceeOption

type UserTraceeOption func(*UserTracee)

func WithTraceeExePath

func WithTraceeExePath(path string) UserTraceeOption

func WithTraceeLogger

func WithTraceeLogger(logger log.Logger) UserTraceeOption

func WithTraceeResolver

func WithTraceeResolver(r FunctionResolver) UserTraceeOption

func WithTraceeSymBindExclude

func WithTraceeSymBindExclude(symBind ...elf.SymBind) UserTraceeOption

func WithTraceeSymBindInclude

func WithTraceeSymBindInclude(symBind ...elf.SymBind) UserTraceeOption

func WithTraceeSymPatternExclude

func WithTraceeSymPatternExclude(patternExclude string) UserTraceeOption

func WithTraceeSymPatternInclude

func WithTraceeSymPatternInclude(patternInclude string) UserTraceeOption

type UserTraceeOptions

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

type UserTracer

type UserTracer struct {
	*UserTracerOptions
	// contains filtered or unexported fields
}

func NewUserTracer

func NewUserTracer(opts ...UserTracerOpt) *UserTracer

func (*UserTracer) Init

func (t *UserTracer) Init(ctx context.Context) error

func (*UserTracer) Run

func (t *UserTracer) Run(ctx context.Context) error

type UserTracerOpt

type UserTracerOpt func(*UserTracer)

func WithTracerLogger

func WithTracerLogger(logger log.Logger) UserTracerOpt

func WithTracerReport

func WithTracerReport(report bool) UserTracerOpt

func WithTracerStatus

func WithTracerStatus(status bool) UserTracerOpt

func WithTracerTracee

func WithTracerTracee(tracee *UserTracee) UserTracerOpt

func WithTracerVerbose

func WithTracerVerbose(verbose bool) UserTracerOpt

func WithTracerWriter

func WithTracerWriter(w io.Writer) UserTracerOpt

type UserTracerOptions

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

Jump to

Keyboard shortcuts

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