BPF List
 help / color / mirror / Atom feed
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 v7 0/2] bpftool: Add recursive map dumping
Date: Fri, 25 Sep 2026 01:14:32 +0900	[thread overview]
Message-ID: <20260924161434.95116-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 v7, addressing Quentin's review:
- Replace the global -r/--recursive option with a map dump keyword:
    bpftool map dump id 1337 recursive
  Keep the setting local to each invocation and update help, completion
  and selftests. Reject malformed or repeated trailing arguments.
- Shorten the man page to describe the feature and non-atomic traversal;
  remove detailed output/error-format descriptions and adjust line wrapping.
- Rebase onto current bpf-next, preserving the updated per-CPU dump path.

Validation:
- Rebuilt bpftool and the focused selftest runner; all 13 map-dump subtests
  pass in an x86-64 VM, including the low-descriptor-limit cases.
- Checked pinned maps, per-CPU inner-map plain/JSON output, keyword scope
  across batch commands, and rejection of the removed global options.
- Bash completion checks and test_bpftool_synctypes.py pass.

v6: https://lore.kernel.org/r/20260911051053.283421-1-diannaaav@gmail.com
Review: https://lore.kernel.org/r/44ec5184-5a77-413d-9f42-fd93b0abbf11@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                       | 143 ++++-
 .../bpf/prog_tests/bpftool_map_dump.c         | 507 ++++++++++++++++++
 4 files changed, 655 insertions(+), 13 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/bpftool_map_dump.c


base-commit: 740eb74b8d2e3b7850e55b15257c8c0b0fc4a125
-- 
2.55.0


             reply	other threads:[~2026-09-24 16:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 16:14 Tianyi Chen [this message]
2026-09-24 16:14 ` [PATCH bpf-next v7 1/2] bpftool: Add recursive map dumping Tianyi Chen
2026-09-25 11:26   ` Quentin Monnet
2026-09-25 17:46     ` Tianyi Chen
2026-09-24 16:14 ` [PATCH bpf-next v7 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=20260924161434.95116-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