bpfloader

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package bpfloader manages the lifecycle of eBPF programs and their kernel attachments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

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

Loader manages the lifecycle of BPF programs and their attachments.

func New

func New() (*Loader, error)

New creates a new Loader and loads the BPF objects into the kernel.

func NewWithOptions added in v0.5.0

func NewWithOptions(opts LoaderOptions) (*Loader, error)

NewWithOptions creates a new Loader with the given options.

func (*Loader) Attach

func (l *Loader) Attach() error

Attach attaches the BPF programs to their tracepoints.

func (*Loader) Close

func (l *Loader) Close() error

Close releases all BPF resources including links and loaded objects. Link detachments are parallelized since each involves kernel RCU synchronization (~200ms).

func (*Loader) OpenRingBuffer

func (l *Loader) OpenRingBuffer() (*ringbuf.Reader, error)

OpenRingBuffer opens and returns a ring buffer reader for receiving events.

func (*Loader) TrackPID

func (l *Loader) TrackPID(pid int) error

TrackPID adds a PID to the tracked_pids map in the BPF program.

func (*Loader) UntrackPID added in v0.5.0

func (l *Loader) UntrackPID(pid int) error

UntrackPID removes a PID from the tracked_pids map in the BPF program.

type LoaderOptions added in v0.5.0

type LoaderOptions struct {
	AmbientMode    bool // Enable daemon mode (monitor all execs, not just tracked trees)
	RingBufferSize int  // Ring buffer size in bytes (0 = default 2MB)
}

LoaderOptions configures BPF program loading behavior.

Jump to

Keyboard shortcuts

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