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

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

Changes in v6:
- Grow the pending inner-map ID array with libbpf_ensure_mem() instead of
  reallocating for every ID. Keep the existing bound on open descriptors.
- Check snprintf() failures and truncation before advancing the expected
  JSON buffer offset in the multiple-root selftest.
- Clarify the unused array-slot comment, name the large output buffer
  size, and shorten the selftest commit message.

The formatting check is defensive; I have not established the reported
stack overflow in v5's fixed four-map fixture.

v5: https://lore.kernel.org/r/20260911034715.219552-1-diannaaav@gmail.com
AI reviews:
https://lore.kernel.org/r/c55811f4eb2a0d4884ee2eb3167557cd405a5b7aecd988a51acf525c77e3a0e1@mail.kernel.org
https://lore.kernel.org/r/4fba1aedc906d6c5072a1ae9a72496e6d307abd60c456cb870077cf93cc8f4ce@mail.kernel.org
https://lore.kernel.org/r/20260911035503.891321F000FF@smtp.kernel.org

Validation:
- Rebuilt bpftool and the focused selftest runner.
- All 12 bpftool_map_dump subtests passed, including the 64-inner-map
  cases under RLIMIT_NOFILE=32 and the multiple-root JSON check.
- Tested alongside the pending batch-dump series: all 23 selected
  subtests passed, with no skips or failures, in an x86-64 KVM guest
  running Linux 7.3.0-rc2 from bpf/master, using LLVM 20 BPF objects.
- Diff and bpftool synchronization checks passed; checkpatch reported
  no errors. The generated patches apply cleanly to current bpf-next.

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                       | 130 ++++-
 .../bpf/prog_tests/bpftool_map_dump.c         | 480 ++++++++++++++++++
 6 files changed, 631 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] 3+ messages in thread

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

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