ir

package
v0.0.0-...-e5c38ee Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package ir contains a representation of probes as applied to a specific binary.

The key data structure is ir.Program, which represents all the information needed to describe the set of probes that will be connected to a single binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareProbeIDs

func CompareProbeIDs[A, B ProbeIDer](a A, b B) int

CompareProbeIDs compares two probe definitions by their ID and version.

Types

type CaptureConfig

type CaptureConfig interface {
	GetMaxReferenceDepth() uint32
	GetMaxFieldCount() uint32
	GetMaxLength() uint32
	GetMaxCollectionSize() uint32
}

CaptureConfig is the capture configuration of a probe.

type EventKind

type EventKind uint8

EventKind is the kind of event.

const (

	// EventKindEntry is an event that emits an entry.
	EventKindEntry EventKind
	// EventKindReturn is an event that emits a return.
	EventKindReturn
	// EventKindLine is an event that emits a line.
	EventKindLine
)

func (EventKind) IsValid

func (k EventKind) IsValid() bool

IsValid returns true if the event kind is valid.

func (EventKind) String

func (i EventKind) String() string

type FunctionWhere

type FunctionWhere interface {
	Where
	Location() (functionName string)
}

FunctionWhere is a where clause of a probe that is a function.

type Issue

type Issue struct {
	Kind    IssueKind
	Message string
}

Issue is an issue that was encountered while processing a probe.

func (Issue) IsNone

func (i Issue) IsNone() bool

IsNone returns true if the issue is empty.

type IssueKind

type IssueKind int

IssueKind is the kind of issue that was encountered.

const (

	// IssueKindInvalidProbeDefinition is an issue that was encountered while
	// deserializing a probe definition.
	IssueKindInvalidProbeDefinition IssueKind
	// IssueKindTargetNotFoundInBinary is an issue that was encountered while
	// processing a probe definition and failing to find the target in the
	// binary.
	IssueKindTargetNotFoundInBinary
	// IssueKindUnsupportedFeature is an issue that was encountered while
	// processing a probe definition that uses a feature that is not supported.
	IssueKindUnsupportedFeature
	// IssueKindMalformedExecutable is an issue that was encountered while
	// processing a probe definition that uses a malformed executable.
	IssueKindMalformedExecutable
	// IssueKindInvalidDWARF is an issue that was encountered while processing
	// a probe definition that uses an invalid DWARF.
	IssueKindInvalidDWARF
	// IssueKindDisassemblyFailed is an issue that was encountered while
	// disassembling an instruction.
	IssueKindDisassemblyFailed
)

func (IssueKind) String

func (i IssueKind) String() string

type LineWhere

type LineWhere interface {
	Where
	Line() (functionName string, sourceFile string, lineNumber string)
}

LineWhere is a where clause of a probe that is a line within a function.

type ProbeDefinition

type ProbeDefinition interface {
	ProbeIDer
	// GetTags returns the tags of the probe.
	GetTags() []string
	// GetKind returns the kind of the probe.
	GetKind() ProbeKind
	// GetWhere returns the where clause of the probe.
	GetWhere() Where
	// GetCaptureConfig returns the capture configuration of the probe.
	GetCaptureConfig() CaptureConfig
	// ThrottleConfig returns the throttle configuration of the probe.
	GetThrottleConfig() ThrottleConfig
	// GetTemplate returns the template of the probe.
	GetTemplate() TemplateDefinition
}

ProbeDefinition abstracts the configuration of a probe.

type ProbeIDer

type ProbeIDer interface {
	// GetID returns the ID of the probe.
	GetID() string
	// GetVersion returns the version of the probe.
	GetVersion() int
}

ProbeIDer is an interface that allows for comparison of probe definitions.

type ProbeIssue

type ProbeIssue struct {
	ProbeDefinition `json:"probe_definition"`
	Issue           `json:"issue"`
}

ProbeIssue is an issue that was encountered while processing a probe.

type ProbeKind

type ProbeKind uint8

ProbeKind is the kind of probe.

const (

	// ProbeKindLog is a probe that emits a log.
	ProbeKindLog ProbeKind
	// ProbeKindSpan is a probe that emits a span.
	ProbeKindSpan
	// ProbeKindMetric is a probe that updates a metric.
	ProbeKindMetric
	// ProbeKindSnapshot is a probe that emits a snapshot.
	//
	// Internally in rcjson these are log probes with capture_snapshot set to
	// true.
	ProbeKindSnapshot
)

func (ProbeKind) IsValid

func (k ProbeKind) IsValid() bool

IsValid returns true if the probe kind is valid.

func (ProbeKind) String

func (i ProbeKind) String() string

type TemplateDefinition

type TemplateDefinition interface {
	GetTemplateString() string
	GetSegments() iter.Seq[TemplateSegmentDefinition]
}

TemplateDefinition represents the configuration-time template definition

type TemplateSegmentDefinition

type TemplateSegmentDefinition interface {
	TemplateSegment() // marker method
}

TemplateSegmentDefinition represents a configuration-time template segment

type TemplateSegmentExpression

type TemplateSegmentExpression interface {
	TemplateSegmentDefinition
	GetDSL() string
	GetJSON() json.RawMessage
}

TemplateSegmentExpression represents an expression segment in configuration

type TemplateSegmentString

type TemplateSegmentString interface {
	TemplateSegmentDefinition
	GetString() string
}

TemplateSegmentString represents a string literal segment in configuration

type ThrottleConfig

type ThrottleConfig interface {
	GetThrottlePeriodMs() uint32
	GetThrottleBudget() int64
}

ThrottleConfig is the throttle configuration of a probe.

type Where

type Where interface {
	Where() // marker method
}

Where is a where clause of a probe.

Jump to

Keyboard shortcuts

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