From: Tianyi Chen <hi@tychen.cc>
To: bpf@vger.kernel.org
Cc: Tianyi Chen <hi@tychen.cc>,
ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
eddyz87@gmail.com, memxor@gmail.com, shuah@kernel.org,
linux-kselftest@vger.kernel.org, qmo@kernel.org,
ihor.solodrai@linux.dev
Subject: [PATCH bpf-next v12 0/3] bpftool: Add recursive map dumping
Date: Wed, 11 Nov 2026 16:19:24 +0900 [thread overview]
Message-ID: <cover.1794380385.git.hi@tychen.cc> (raw)
Dump each inner map in the entry that references it. This series is
based on the batch dump v10 series [1]; apply that series first.
Changes in v12:
- Separate plain inner-map dumps with blank lines and indent raw
entries and counts, including wrapped and per-CPU values.
- Read outer entries individually during recursion; keep batch lookups
for inner maps.
- Use LIBBPF_OPTS in test_unchanged() and check formatting and lookup
counts. Size the per-CPU layout buffer from the possible CPU count.
All 33 subtests in the combined batch/dump/access run, including the
11 recursive subtests, pass in x86-64 KVM with both 2 and 128 possible
CPUs (2 CPUs online). The old combined bpftool fails the formatting and
outer-lookup checks. Non-recursive output is unchanged.
[1] https://lore.kernel.org/r/cover.1794380384.git.hi@tychen.cc
v11: https://lore.kernel.org/r/cover.1793818386.git.hi@tychen.cc
Tianyi Chen (3):
bpftool: Reset map info before each query in show and dump loops
bpftool: Add recursive map dumping
selftests/bpf: Cover recursive bpftool map dumps
.../bpf/bpftool/Documentation/bpftool-map.rst | 10 +-
tools/bpf/bpftool/bash-completion/bpftool | 3 +
tools/bpf/bpftool/map.c | 131 ++++-
.../prog_tests/bpftool_map_dump_recursive.c | 480 ++++++++++++++++++
.../bpf/progs/bpftool_map_dump_recursive.c | 38 ++
5 files changed, 639 insertions(+), 23 deletions(-)
create mode 100644 tools/testing/selftests/bpf/prog_tests/bpftool_map_dump_recursive.c
create mode 100644 tools/testing/selftests/bpf/progs/bpftool_map_dump_recursive.c
base-commit: 0fb18ce8a2e9de830433923cf65838933d615359
prerequisite-patch-id: f2cb564c4555c7d7f3c87a7e9827a6e91816affd
prerequisite-patch-id: b8e7968eb997646d032c3489c5462230ee5837e6
--
2.56.0
next reply other threads:[~2026-11-11 7:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 7:19 Tianyi Chen [this message]
2026-11-11 7:19 ` [PATCH bpf-next v12 1/3] bpftool: Reset map info before each query in show and dump loops Tianyi Chen
2026-11-11 7:19 ` [PATCH bpf-next v12 2/3] bpftool: Add recursive map dumping Tianyi Chen
2026-11-11 16:24 ` Quentin Monnet
2026-11-11 7:19 ` [PATCH bpf-next v12 3/3] selftests/bpf: Cover recursive bpftool map dumps Tianyi Chen
2026-11-11 16:24 ` Quentin Monnet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1794380385.git.hi@tychen.cc \
--to=hi@tychen.cc \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=ihor.solodrai@linux.dev \
--cc=linux-kselftest@vger.kernel.org \
--cc=memxor@gmail.com \
--cc=qmo@kernel.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.