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

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


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

end of thread, other threads:[~2026-09-26  1:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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