instrumentation

package
v0.0.0-...-d025890 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CurrentOptions = loadOptionsFromEnvironment()
)

Global instrumentation options

Functions

func ChannelClose

func ChannelClose(chID, goroutineID int)

ChannelClose records a channel close operation

func ChannelRecv

func ChannelRecv(chID, receiverID int, value interface{})

ChannelRecv records a channel receive operation

func ChannelSend

func ChannelSend(chID, senderID int, value interface{})

ChannelSend records a channel send operation

func FuncEntry

func FuncEntry(funcName string, file string, line int)

FuncEntry records a function entry event

func FuncExit

func FuncExit(funcName string, file string, line int)

FuncExit records a function exit event

func GoroutineCreate

func GoroutineCreate(gID int)

GoroutineCreate records a goroutine creation event

func GoroutineSwitch

func GoroutineSwitch(fromID, toID int)

GoroutineSwitch records a scheduler switch between goroutines

func InitInstrumentation

func InitInstrumentation(r recorder.Recorder)

InitInstrumentation initializes the instrumentation with a recorder

func InitRuntimeTracing

func InitRuntimeTracing(rec recorder.Recorder) error

InitRuntimeTracing initializes runtime/trace integration

func MutexLock

func MutexLock(mutexID, goroutineID int)

MutexLock records a mutex lock acquisition

func MutexUnlock

func MutexUnlock(mutexID, goroutineID int)

MutexUnlock records a mutex unlock operation

func RecordStatement

func RecordStatement(funcName string, file string, line int, description string)

RecordStatement can be used to record execution of a specific statement

func SetInstrumentationOptions

func SetInstrumentationOptions(options InstrumentationOptions)

SetInstrumentationOptions sets the current instrumentation options

func ShouldInstrument

func ShouldInstrument(packagePath string) bool

ShouldInstrument checks if a package should be instrumented

func StopRuntimeTracing

func StopRuntimeTracing()

StopRuntimeTracing stops runtime trace integration

func TraceChannelOperation

func TraceChannelOperation(ch interface{}, op string, value interface{})

TraceChannelOperation records a channel operation using our instrumentation and runtime trace

func TraceMutexOperation

func TraceMutexOperation(mu interface{}, op string)

TraceMutexOperation records a mutex operation using our instrumentation and runtime trace

Types

type InstrumentationOptions

type InstrumentationOptions struct {
	// Enabled indicates whether instrumentation is enabled
	Enabled bool

	// IncludePackages is a list of package paths to instrument
	// Empty means all packages are instrumented
	IncludePackages []string

	// ExcludePackages is a list of package paths to exclude from instrumentation
	// This takes precedence over IncludePackages
	ExcludePackages []string

	// InstrumentStdlib indicates whether to instrument standard library code
	InstrumentStdlib bool
}

InstrumentationOptions stores configuration for selective instrumentation

func DefaultInstrumentationOptions

func DefaultInstrumentationOptions() InstrumentationOptions

DefaultInstrumentationOptions returns the default instrumentation options

Jump to

Keyboard shortcuts

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