Libbpf userspace function ring_buffer__add
Add a new ring buffer to a ring buffer manager.
Definition
typedef int (*ring_buffer_sample_fn)(void *ctx, void *data, size_t size);
int ring_buffer__add(struct ring_buffer *rb, int map_fd, ring_buffer_sample_fn sample_cb, void *ctx);
Parameters
rb
: ring buffer manager to add the new ring buffer tomap_fd
: file descriptor of theBPF_MAP_TYPE_RINGBUF
map of the ring buffer to addsample_cb
: callback function that will be called when a sample is ready for the ring bufferctx
: context that will be passed to the callback function
Usage
Docs could be improved
This part of the docs is incomplete, contributions are very welcome
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome