Add a ring_buffer__query function mimicking the existing bpf_ringbuf_query helper but accessible from usermode. This can be useful for programs to query ringbuffer information at runtime, e.g. seeing how much free space the ringbuffers currently have. Martin Kelly (2): libbpf: add ring_buffer__query selftests/bpf: add tests for ring_buffer__query tools/lib/bpf/libbpf.h | 2 ++ tools/lib/bpf/libbpf.map | 1 + tools/lib/bpf/ringbuf.c | 33 +++++++++++++++++++ .../selftests/bpf/prog_tests/ringbuf.c | 22 +++++++++++++ 4 files changed, 58 insertions(+) -- 2.34.1