Documentation
¶
Index ¶
- Constants
- type BaseProbe
- func (p *BaseProbe) Close() error
- func (p *BaseProbe) Config() domain.Configuration
- func (p *BaseProbe) Context() context.Context
- func (p *BaseProbe) DecodeFun(em *ebpf.Map) (domain.EventDecoder, bool)
- func (p *BaseProbe) Dispatcher() domain.EventDispatcher
- func (p *BaseProbe) Events() []*ebpf.Map
- func (p *BaseProbe) GetBPFName(baseName string) string
- func (p *BaseProbe) GoReaderLoop(fn func())
- func (p *BaseProbe) Initialize(ctx context.Context, cfg domain.Configuration) error
- func (p *BaseProbe) IsRunning() bool
- func (p *BaseProbe) Logger() *logger.Logger
- func (p *BaseProbe) Name() string
- func (p *BaseProbe) SetDispatcher(dispatcher domain.EventDispatcher)
- func (p *BaseProbe) Start(ctx context.Context) error
- func (p *BaseProbe) StartPerfEventReader(em *ebpf.Map, decoder domain.EventDecoder) error
- func (p *BaseProbe) StartRingbufReader(em *ebpf.Map, decoder domain.EventDecoder) error
- func (p *BaseProbe) Stop(ctx context.Context) error
- func (p *BaseProbe) TrackPerfReader(c io.Closer)
- func (p *BaseProbe) TrackReader(c io.Closer)
Constants ¶
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 ¶
NewBaseProbe creates a new BaseProbe instance.
func (*BaseProbe) Config ¶
func (p *BaseProbe) Config() domain.Configuration
Config returns the probe's configuration.
func (*BaseProbe) Dispatcher ¶
func (p *BaseProbe) Dispatcher() domain.EventDispatcher
Dispatcher returns the event dispatcher.
func (*BaseProbe) Events ¶
Events returns the eBPF maps used for event collection. Concrete probes should override this method.
func (*BaseProbe) GetBPFName ¶
GetBPFName returns the appropriate eBPF bytecode filename.
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 ¶
Initialize sets up the probe with configuration and dependencies.
func (*BaseProbe) SetDispatcher ¶
func (p *BaseProbe) SetDispatcher(dispatcher domain.EventDispatcher)
func (*BaseProbe) Start ¶
Start begins the probe's operation. Concrete probes should override this method to implement probe-specific startup.
func (*BaseProbe) StartPerfEventReader ¶
StartPerfEventReader starts a perf event reader for the given map.
func (*BaseProbe) StartRingbufReader ¶
StartRingbufReader starts a ringbuf reader for the given map.
func (*BaseProbe) TrackPerfReader ¶
TrackPerfReader registers a perf/ringbuf reader to be closed in Close().
func (*BaseProbe) TrackReader ¶
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.