From: Quentin Monnet <qmo@kernel.org>
To: Tianyi Chen <hi@tychen.cc>, bpf@vger.kernel.org
Cc: andrii@kernel.org, eddyz87@gmail.com, ihor.solodrai@linux.dev,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH bpf-next v8 1/2] bpftool: Add recursive map dumping
Date: Fri, 25 Sep 2026 21:21:08 +0100 [thread overview]
Message-ID: <43549d30-0f47-46a2-a60f-fb6f252e6738@kernel.org> (raw)
In-Reply-To: <20260925174402.2028649-2-hi@tychen.cc>
2026-09-26 02:44 UTC+0900 ~ Tianyi Chen <hi@tychen.cc>
> Dumping a map-of-maps currently shows inner map IDs without their
> contents. Add a recursive keyword to map dump to include referenced
> inner maps, leaving the default output unchanged. Show selected maps
> followed by distinct inner maps, preserving plain and BTF formatting
> and using an array of map objects for JSON output.
>
> Holding every discovered inner-map FD open would make descriptor use
> grow with the number of maps and could exhaust RLIMIT_NOFILE. Keep the
> selected map FDs open, queue distinct inner map IDs, and open, dump and
> close each queued map in turn. This needs only one additional map FD.
> The tradeoff is deferred ID resolution: concurrently removed inner
> maps can disappear before they are opened, so the dump is not atomic.
>
> Report failure when an inner map cannot be opened, retain per-entry
> lookup errors, and close JSON containers before returning.
>
> Link: https://github.com/libbpf/bpftool/issues/58
> Assisted-by: LLM
> Signed-off-by: Tianyi Chen <hi@tychen.cc>
> ---
> .../bpf/bpftool/Documentation/bpftool-map.rst | 15 +-
> tools/bpf/bpftool/bash-completion/bpftool | 3 +
> tools/bpf/bpftool/map.c | 147 ++++++++++++++++--
> 3 files changed, 151 insertions(+), 14 deletions(-)
>
> diff --git a/tools/bpf/bpftool/Documentation/bpftool-map.rst b/tools/bpf/bpftool/Documentation/bpftool-map.rst
> index e4ed7e701c9e..0b804926d829 100644
> --- a/tools/bpf/bpftool/Documentation/bpftool-map.rst
> +++ b/tools/bpf/bpftool/Documentation/bpftool-map.rst
> @@ -16,7 +16,8 @@ SYNOPSIS
>
> **bpftool** [*OPTIONS*] **map** *COMMAND*
>
> -*OPTIONS* := { |COMMON_OPTIONS| | { **-f** | **--bpffs** } | { **-n** | **--nomount** } }
> +*OPTIONS* := { |COMMON_OPTIONS| |
> +{ **-f** | **--bpffs** } | { **-n** | **--nomount** } }
This hunk is no longer necessary now that we use a keyword rather than
an option, please drop the rewrap.
Looks mostly good otherwise, but Sashiko's finding seems correct, so
please look into it.
Thanks,
Quentin
next prev parent reply other threads:[~2026-09-25 20:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 17:44 [PATCH bpf-next v8 0/2] bpftool: Add recursive map dumping Tianyi Chen
2026-09-25 17:44 ` [PATCH bpf-next v8 1/2] " Tianyi Chen
2026-09-25 18:32 ` bot+bpf-ci
2026-09-26 1:44 ` Tianyi Chen
2026-09-25 20:21 ` Quentin Monnet [this message]
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=43549d30-0f47-46a2-a60f-fb6f252e6738@kernel.org \
--to=qmo@kernel.org \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=eddyz87@gmail.com \
--cc=hi@tychen.cc \
--cc=ihor.solodrai@linux.dev \
--cc=linux-kselftest@vger.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