Documentation ¶
Overview ¶
Package ringbuf allows interacting with Linux BPF ring buffer.
BPF allows submitting custom events to a BPF ring buffer map set up by userspace. This is very useful to push things like packet samples from BPF to a daemon running in user space.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrClosed = os.ErrClosed
)
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader allows reading bpf_ringbuf_output from user space.
func (*Reader) Read ¶
Read the next record from the BPF ringbuf.
Returns os.ErrClosed if Close is called on the Reader, or os.ErrDeadlineExceeded if a deadline was set.
func (*Reader) ReadInto ¶
ReadInto is like Read except that it allows reusing Record and associated buffers.
func (*Reader) SetDeadline ¶
SetDeadline controls how long Read and ReadInto will block waiting for samples.
Passing a zero time.Time will remove the deadline.