Skip to content

bpftool: Consume ring buffer maps with event_pipe

Tianyi Chen bpf linux-kselftest 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest2 patches 4 repliesIn review

Changes in v3 from the cover letter

- Remove redundant wording from the manual while retaining the warning about consuming records and sharing the consumer position.
- Explain callback stopping and signal handling in the commit message.
- Rebase onto current bpf-next and use Assisted-by: LLM.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2bpftool: Read ring buffer maps with event_pipetools/bpf/bpftool/Documentation/bpftool-map.rst tools/bpf/bpftool/bash-completion/bpftool tools/bpf/bpftool/map_perf_ring.c+81 -242 replies
2/2selftests/bpf: Cover bpftool ring buffer event_pipetools/testing/selftests/bpf/prog_tests/bpftool_ringbuf.c tools/testing/selftests/bpf/progs/bpftool_ringbuf.c+472 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH bpf-next v3 0/2] bpftool: Consume ring buffer maps with event_pipe

Extend map event_pipe to BPF ring buffer maps using libbpf's ring buffer manager. Print complete records in plain or JSON format, reject CPU/index selectors for ring buffers, and document the shared consumer position.

Changes in v3:
- Remove redundant wording from the manual while retaining the warning about consuming records and sharing the consumer position.
- Explain callback stopping and signal handling in the commit message.
- Rebase onto current bpf-next and use Assisted-by: LLM.

The implementation and v2 tests, including pretty output, pinned paths, empty streams and the perf-event-array regression case, are unchanged.

v2: https://lore.kernel.org/r/[email protected]
Request: https://github.com/libbpf/bpftool/issues/54

The previous version's CI PR expired after repeated "Patch is empty" reports. The revised series applies cleanly to the current tree and is sent as a new thread using git format-patch and git send-email.

Validation:
- Built bpftool and its manual pages, and built the focused selftest runner with LLVM 20.
- All 17 bpftool_ringbuf subtests passed with no skips or failures in an x86-64 KVM guest running Linux 7.3.0-rc2 from current bpf/master.
- The four bpftool series were tested together: all 69 subtests passed. The cpumask suite (36 subtests) and test_maps also passed with no skips.
- Bash syntax and the existing bpftool synchronization checks passed.

This was a focused run; unrelated selftests requiring unavailable kernel features were excluded from the build with PERMISSIVE=1.

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 |  14 +-
 tools/bpf/bpftool/bash-completion/bpftool     |   4 +-
 tools/bpf/bpftool/map_perf_ring.c             |  87 +++-
 .../bpf/prog_tests/bpftool_ringbuf.c          | 425 ++++++++++++++++++
 .../selftests/bpf/progs/bpftool_ringbuf.c     |  47 ++
 5 files changed, 553 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

base-commit: af0b84a9215d951d16f26b7ee34353b970cf5d4e

Signature · 1 line
2.55.0