base

package
v2.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TcFuncNameIngress = "ingress_cls_func"
	TcFuncNameEgress  = "egress_cls_func"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseProbe

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

BaseProbe provides common functionality for all probes. Concrete probes should embed this struct and implement probe-specific logic.

func NewBaseProbe

func NewBaseProbe(name string) *BaseProbe

NewBaseProbe creates a new BaseProbe instance.

func (*BaseProbe) Close

func (p *BaseProbe) Close() error

Close releases all resources.

func (*BaseProbe) Config

func (p *BaseProbe) Config() domain.Configuration

Config returns the probe's configuration.

func (*BaseProbe) Context

func (p *BaseProbe) Context() context.Context

Context returns the probe's context.

func (*BaseProbe) DecodeFun

func (p *BaseProbe) DecodeFun(em *ebpf.Map) (domain.EventDecoder, bool)

func (*BaseProbe) Dispatcher

func (p *BaseProbe) Dispatcher() domain.EventDispatcher

Dispatcher returns the event dispatcher.

func (*BaseProbe) Events

func (p *BaseProbe) Events() []*ebpf.Map

Events returns the eBPF maps used for event collection. Concrete probes should override this method.

func (*BaseProbe) GoReaderLoop

func (p *BaseProbe) GoReaderLoop(fn func())

GoReaderLoop runs fn in a goroutine tracked for shutdown ordering: Close() closes perf/ringbuf readers first, waits for all GoReaderLoop goroutines to exit, then closes the dispatcher. Probes must use this for read loops that may Dispatch after Read returns (e.g. deferred flush).

func (*BaseProbe) Initialize

func (p *BaseProbe) Initialize(ctx context.Context, cfg domain.Configuration) error

Initialize sets up the probe with configuration and dependencies.

func (*BaseProbe) IsRunning

func (p *BaseProbe) IsRunning() bool

IsRunning returns whether the probe is currently active.

func (*BaseProbe) Logger

func (p *BaseProbe) Logger() *logger.Logger

Logger returns the probe's logger.

func (*BaseProbe) Name

func (p *BaseProbe) Name() string

Name returns the probe's identifier.

func (*BaseProbe) SelectBytecode added in v2.8.0

func (p *BaseProbe) SelectBytecode(baseName string) (string, error)

SelectBytecode returns the stable, embedded bytecode key resolved during Initialize.

func (*BaseProbe) SetDispatcher

func (p *BaseProbe) SetDispatcher(dispatcher domain.EventDispatcher)

func (*BaseProbe) Start

func (p *BaseProbe) Start(ctx context.Context) error

Start begins the probe's operation. Concrete probes should override this method to implement probe-specific startup.

func (*BaseProbe) StartPerfEventReader

func (p *BaseProbe) StartPerfEventReader(em *ebpf.Map, decoder domain.EventDecoder) error

StartPerfEventReader starts a perf event reader for the given map.

func (*BaseProbe) StartRingbufReader

func (p *BaseProbe) StartRingbufReader(em *ebpf.Map, decoder domain.EventDecoder) error

StartRingbufReader starts a ringbuf reader for the given map.

func (*BaseProbe) Stop

func (p *BaseProbe) Stop(ctx context.Context) error

Stop gracefully stops the probe.

func (*BaseProbe) TrackPerfReader

func (p *BaseProbe) TrackPerfReader(c io.Closer)

TrackPerfReader registers a perf/ringbuf reader to be closed in Close().

func (*BaseProbe) TrackReader

func (p *BaseProbe) TrackReader(c io.Closer)

TrackReader registers a reader to be closed when the probe shuts down. Probes that implement a custom perf read loop should call TrackReader with the same reader instance they pass to the goroutine, matching StartPerfEventReader lifecycle.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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