Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH bpf-next v12 0/3] bpftool: Add recursive map dumping
@ 2026-11-11  7:19 Tianyi Chen
  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
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tianyi Chen @ 2026-11-11  7:19 UTC (permalink / raw)
  To: bpf
  Cc: Tianyi Chen, ast, daniel, andrii, eddyz87, memxor, shuah,
	linux-kselftest, qmo, ihor.solodrai

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


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

end of thread, other threads:[~2026-11-11 16:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-11  7:19 [PATCH bpf-next v12 0/3] bpftool: Add recursive map dumping Tianyi Chen
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

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