Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH bpf-next v4 0/2] bpftool: Add recursive map dumping
@ 2026-09-11  2:50 Tianyi Chen
  2026-09-11  2:50 ` [PATCH bpf-next v4 1/2] " Tianyi Chen
  2026-09-11  2:51 ` [PATCH bpf-next v4 2/2] selftests/bpf: Cover recursive bpftool map dumps Tianyi Chen
  0 siblings, 2 replies; 4+ messages in thread
From: Tianyi Chen @ 2026-09-11  2:50 UTC (permalink / raw)
  To: qmo, bpf; +Cc: andrii, eddyz87, ihor.solodrai, linux-kselftest

Add -r/--recursive to dump the contents of referenced inner maps after
the selected roots, with deduplication and bounded descriptor use.
The second patch covers output formats, shared and empty maps,
unsupported lookups, and operation under a low descriptor limit.

Changes in v4:
- Clarify that the map-of-maps helper returns whether the map is outer.
- Return -1 consistently after reporting failure to track a root map.
- Explain the descriptor bound and deferred ID lookup in the commit
  description.
- Rebase onto current bpf-next and use Assisted-by: LLM.

The earlier functional review changes, including closing each discovered
inner-map FD after dumping it, are retained.

v3: https://lore.kernel.org/r/178874362960.1415955.17339804697296063298.recursive-v3-1@tychen.cc
Request: https://github.com/libbpf/bpftool/issues/58

The previous version's CI PR expired after repeated "Patch is empty"
reports. The revised series applies cleanly to the current tree and is
sent as a new thread using git format-patch and git send-email.

Validation:
- Built bpftool and its manual pages, and built the focused selftest
  runner with LLVM 20.
- All 12 bpftool_map_dump subtests passed with no skips or failures
  in an x86-64 KVM guest running Linux 7.3.0-rc2 from current bpf/master.
- The four bpftool series were tested together: all 69 subtests passed.
  The cpumask suite (36 subtests) and test_maps also passed with no skips.
- Bash syntax and the existing bpftool synchronization checks passed.

This was a focused run; unrelated selftests requiring unavailable kernel
features were excluded from the build with PERMISSIVE=1.

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

 .../bpf/bpftool/Documentation/bpftool-map.rst |  22 +-
 tools/bpf/bpftool/bash-completion/bpftool     |   2 +-
 tools/bpf/bpftool/main.c                      |   7 +-
 tools/bpf/bpftool/main.h                      |   1 +
 tools/bpf/bpftool/map.c                       | 131 ++++-
 .../bpf/prog_tests/bpftool_map_dump.c         | 465 ++++++++++++++++++
 6 files changed, 617 insertions(+), 11 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/bpftool_map_dump.c


base-commit: af0b84a9215d951d16f26b7ee34353b970cf5d4e
-- 
2.55.0


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

end of thread, other threads:[~2026-09-11  3:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11  2:50 [PATCH bpf-next v4 0/2] bpftool: Add recursive map dumping Tianyi Chen
2026-09-11  2:50 ` [PATCH bpf-next v4 1/2] " Tianyi Chen
2026-09-11  2:51 ` [PATCH bpf-next v4 2/2] selftests/bpf: Cover recursive bpftool map dumps Tianyi Chen
2026-09-11  3:37   ` bot+bpf-ci

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