Libbpf userspace function perf_buffer__buffer_fd
Return perf_event FD of a ring buffer in buf_idx
slot of BPF_MAP_TYPE_PERF_EVENT_ARRAY
BPF map. This file descriptor can be polled for new data using select
/poll
/epoll
Linux syscalls.
Definition
int perf_buffer__buffer_fd(const struct perf_buffer *pb, size_t buf_idx);
Parameters
pb
: perf buffer manager to get file descriptor frombuf_idx
: index of the perf ring buffer to get file descriptor from
Returns
File descriptor of the perf ring buffer in the buf_idx
slot of the perf buffer, or negative number on error. errno
will be set to the error code.
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