libbpf: Add ring__avail_data_size
authorMartin Kelly <martin.kelly@crowdstrike.com>
Mon, 25 Sep 2023 21:50:38 +0000 (14:50 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 25 Sep 2023 23:22:42 +0000 (16:22 -0700)
commit3b34d2972612299fb38ad7f3c2bc62c2d03237f3
treee5045f2680621f6877dbad69369640cd65c0c4e5
parentb18db8712ecf5c880da222f6e0d7be53f0af4c4d
libbpf: Add ring__avail_data_size

Add ring__avail_data_size for querying the currently available data in
the ringbuffer, similar to the BPF_RB_AVAIL_DATA flag in
bpf_ringbuf_query. This is racy during ongoing operations but is still
useful for overall information on how a ringbuffer is behaving.

Signed-off-by: Martin Kelly <martin.kelly@crowdstrike.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230925215045.2375758-8-martin.kelly@crowdstrike.com
tools/lib/bpf/libbpf.h
tools/lib/bpf/libbpf.map
tools/lib/bpf/ringbuf.c