BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpftool: Consume ring buffer maps with event_pipe
@ 2026-09-06 17:07 Tianyi Chen
  2026-09-06 17:07 ` [PATCH bpf-next 1/2] bpftool: Read " Tianyi Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Tianyi Chen @ 2026-09-06 17:07 UTC (permalink / raw)
  To: bpf
  Cc: Tianyi Chen, Quentin Monnet, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi,
	Martin KaFai Lau, Song Liu, Yonghong Song, Jiri Olsa,
	Emil Tsalapatis, Ihor Solodrai, Shuah Khan, linux-kernel,
	linux-kselftest

This series extends map event_pipe to BPF ring buffer maps through
libbpf's ring buffer manager. Records contain a size and raw bytes in
plain or JSON output. CPU/index selectors remain perf-array specific.
The documentation explains the shared, destructive consumer position.

The existing perf event array path is retained. Signal handlers only set
a stop flag; messages and JSON closure happen in the main path. Poll
and output errors return failure instead of silently ending a stream.

Related request:
https://github.com/libbpf/bpftool/issues/54

The series is based on bpf-next and is independent of the flags and
batch-dump series sent alongside it.

Validation:
- Full bpftool and focused BPF selftests builds with LLVM 20, plus
  bpftool-map man page generation and Bash completion syntax checks.
- All 12 bpftool_ringbuf subtests passed in an x86-64 KVM guest running
  Linux 7.3.0-rc1, against a bpftool built with only this series.
- The perf event array regression also passed against unmodified bpftool.
- Injecting EIO into epoll_wait returned failure with an errno diagnostic
  on stderr and a complete empty JSON array on stdout.

Only focused tests were run; this does not claim a full BPF selftest
suite run. Strict checkpatch has no errors or checks. Remaining warnings
are the userspace volatile sig_atomic_t signal flag, readable multiline
expected-output strings, and files covered by existing MAINTAINERS
patterns.


Integration check: these three independent series also applied and built
together with my previously posted recursive map-dump v2 series. The
combined 64 subtests passed with no skips or failures in the same guest.

Tianyi Chen (2):
  bpftool: Read ring buffer maps with event_pipe
  selftests/bpf: Cover bpftool ring buffer event_pipe

 .../bpf/bpftool/Documentation/bpftool-map.rst |  15 +-
 tools/bpf/bpftool/bash-completion/bpftool     |   4 +-
 tools/bpf/bpftool/map_perf_ring.c             |  87 +++-
 .../bpf/prog_tests/bpftool_ringbuf.c          | 381 ++++++++++++++++++
 .../selftests/bpf/progs/bpftool_ringbuf.c     |  47 +++
 5 files changed, 510 insertions(+), 24 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/bpftool_ringbuf.c
 create mode 100644 tools/testing/selftests/bpf/progs/bpftool_ringbuf.c

-- 
2.55.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-09-07  5:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-06 17:07 [PATCH bpf-next 0/2] bpftool: Consume ring buffer maps with event_pipe Tianyi Chen
2026-09-06 17:07 ` [PATCH bpf-next 1/2] bpftool: Read " Tianyi Chen
2026-09-06 17:07 ` [PATCH bpf-next 2/2] selftests/bpf: Cover bpftool ring buffer event_pipe Tianyi Chen
2026-09-06 17:18   ` sashiko-bot
2026-09-07  1:21 ` [PATCH bpf-next v2 0/2] bpftool: Consume ring buffer maps with event_pipe Tianyi Chen
2026-09-07  1:21   ` [PATCH bpf-next v2 1/2] bpftool: Read " Tianyi Chen
2026-09-07  2:20     ` bot+bpf-ci
2026-09-07  5:15       ` Tianyi Chen
2026-09-07  1:21   ` [PATCH bpf-next v2 2/2] selftests/bpf: Cover bpftool ring buffer event_pipe Tianyi Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox