BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v9 0/2] bpftool: Add recursive map dumping
@ 2026-09-26  1:42 Tianyi Chen
  2026-09-26  1:42 ` [PATCH bpf-next v9 1/2] " Tianyi Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tianyi Chen @ 2026-09-26  1:42 UTC (permalink / raw)
  To: bpf; +Cc: qmo, andrii, eddyz87, ihor.solodrai, linux-kselftest,
	skokovmaksimevg

Add an opt-in recursive keyword to dump selected maps followed by their
referenced inner maps.

This version is based on current bpf-next plus Maxim Skokov's v2 patch 1/2,
"bpftool: Fail map dump for maps that can't be iterated":
https://lore.kernel.org/r/20260925162031.27259-2-skokovmaksimevg@gmail.com
That patch is a prerequisite, not part of this series. Keep its early
iteration check before recursive plain/BTF output, and retain its error
reporting. I will handle rebasing this series if the prerequisite changes.

Changes in v9:
- Clear map info and reset its length before each query in all three
  do_dump() loops, preventing BTF metadata from leaking between maps.
- Add mixed BTF/non-BTF root and inner-map tests, with different key/value
  sizes, checking complete JSON and plain output.
- Drop the unnecessary OPTIONS rewrap, as Quentin requested.
- Rebase and resolve the overlap with Maxim's patch as described above.

Validation in an x86-64 VM:
- Both new regression cases fail with v8 and pass with v9.
- All 15 bpftool_map_dump subtests pass on the combined tree.
- Non-iterable ringbuf dumps fail with valid error JSON both with and
  without recursion. The bpftool type-sync and shell syntax checks pass.

v8: https://lore.kernel.org/r/20260925174402.2028649-1-hi@tychen.cc
Review: https://lore.kernel.org/r/43549d30-0f47-46a2-a60f-fb6f252e6738@kernel.org
BTF finding: https://lore.kernel.org/r/06229dde91361ba3f8d3c8d5ab0350f4a66643eb72b0c3554b1c146fe8523eac@mail.kernel.org

Tianyi Chen (2):
  bpftool: Add recursive map dumping
  selftests/bpf: Cover recursive bpftool map dumps

 .../bpf/bpftool/Documentation/bpftool-map.rst |  12 +-
 tools/bpf/bpftool/bash-completion/bpftool     |   3 +
 tools/bpf/bpftool/map.c                       | 148 ++++-
 .../bpf/prog_tests/bpftool_map_dump.c         | 602 ++++++++++++++++++
 4 files changed, 752 insertions(+), 13 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/bpftool_map_dump.c


base-commit: b9f30c763c7ecec41fd3f71b8a5a44971c3fddbf
prerequisite-patch-id: 638622a02f200337c410f2078d38d5cfb9f08404
-- 
2.55.0



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

end of thread, other threads:[~2026-09-28 17:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-26  1:42 [PATCH bpf-next v9 0/2] bpftool: Add recursive map dumping Tianyi Chen
2026-09-26  1:42 ` [PATCH bpf-next v9 1/2] " Tianyi Chen
2026-09-28 15:25   ` Quentin Monnet
2026-09-28 17:19     ` Tianyi Chen
2026-09-26  1:42 ` [PATCH bpf-next v9 2/2] selftests/bpf: Cover recursive bpftool map dumps Tianyi Chen
     [not found] ` <effbbc956dbdf4c78d27608f6ef8639908323d0aaabf80e1cd592cccac938c99@mail.kernel.org>
2026-09-26  6:08   ` [PATCH bpf-next v9 0/2] bpftool: Add recursive map dumping Tianyi Chen

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