ringbuf

package
v0.0.0-...-5a97dfb Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosed = errors.New("ringbuf reader was closed")
)

Functions

func Align

func Align(n, alignment int) int

Align returns 'n' updated to 'alignment' boundary.

Types

type Reader

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

Reader allows reading bpf_ringbuf_output from user space.

func NewReader

func NewReader(ringbufMap *ebpf.Map) (r *Reader, err error)

NewReader creates a new BPF ringbuf reader.

func (*Reader) Close

func (r *Reader) Close() error

Close frees resources used by the reader.

It interrupts calls to Read.

func (*Reader) Read

func (r *Reader) Read() (Record, error)

Read the next record from the BPF ringbuf.

Calling Close interrupts the function.

type Record

type Record struct {
	RawSample []byte
}

Jump to

Keyboard shortcuts

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