Skip to content

Libbpf userspace function ring_buffer__add

0.0.9

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 to
  • map_fd: file descriptor of the BPF_MAP_TYPE_RINGBUF map of the ring buffer to add
  • sample_cb: callback function that will be called when a sample is ready for the ring buffer
  • ctx: 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