From: Tianyi Chen <hi@tychen.cc>
To: bpf@vger.kernel.org
Cc: qmo@kernel.org, andrii@kernel.org, eddyz87@gmail.com,
ihor.solodrai@linux.dev, linux-kselftest@vger.kernel.org
Subject: [PATCH bpf-next v8 0/2] bpftool: Add recursive map dumping
Date: Sat, 26 Sep 2026 02:44:00 +0900 [thread overview]
Message-ID: <20260925174402.2028649-1-hi@tychen.cc> (raw)
Add a recursive keyword to map dump to visit referenced inner maps after
the selected roots, with deduplication and bounded descriptor use.
Changes in v8, addressing Quentin's review:
- Parse MAP first with REQ_ARGS()/map_parse_fds(), then consume trailing
recursive keywords. Misplaced keywords now get the MAP parser's error.
- Close selected map FDs on trailing-argument errors.
- Test misplaced-keyword diagnostics and repeated recursive keywords.
- Rebase onto current bpf-next.
All 13 focused subtests pass in an x86-64 VM. A syscall trace also
confirms that both maps selected by name are closed on an argument error.
Completion and bpftool synchronization checks pass.
v7: https://lore.kernel.org/r/20260924161434.95116-1-hi@tychen.cc
Review: https://lore.kernel.org/r/6ed88738-4e3b-407c-90c2-bf7717f3e653@kernel.org
Tianyi Chen (2):
bpftool: Add recursive map dumping
selftests/bpf: Cover recursive bpftool map dumps
.../bpf/bpftool/Documentation/bpftool-map.rst | 15 +-
tools/bpf/bpftool/bash-completion/bpftool | 3 +
tools/bpf/bpftool/map.c | 147 ++++-
.../bpf/prog_tests/bpftool_map_dump.c | 514 ++++++++++++++++++
4 files changed, 665 insertions(+), 14 deletions(-)
create mode 100644 tools/testing/selftests/bpf/prog_tests/bpftool_map_dump.c
base-commit: 7af653d4ebf8e2e17e288715cd67ccf7845f4631
--
2.55.0
next reply other threads:[~2026-09-25 17:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 17:44 Tianyi Chen [this message]
2026-09-25 17:44 ` [PATCH bpf-next v8 1/2] bpftool: Add recursive map dumping Tianyi Chen
2026-09-25 18:32 ` bot+bpf-ci
2026-09-26 1:44 ` Tianyi Chen
2026-09-25 20:21 ` Quentin Monnet
2026-09-26 1:44 ` Tianyi Chen
2026-09-25 17:44 ` [PATCH bpf-next v8 2/2] selftests/bpf: Cover recursive bpftool map dumps Tianyi Chen
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=20260925174402.2028649-1-hi@tychen.cc \
--to=hi@tychen.cc \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=eddyz87@gmail.com \
--cc=ihor.solodrai@linux.dev \
--cc=linux-kselftest@vger.kernel.org \
--cc=qmo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox