Skip to content

bpftool: Support dumping a map with btf_vmlinux_value_type_id

Martin KaFai Lau bpf netdev 3 versions – Applied

Status from this message: Applied. Thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 1 replyApplied
  2. v25 patches 6 repliesSuperseded
  3. v15 patches 13 repliesSuperseded

Changes in v3 from the cover letter

- Remove unnecessary #include "libbpf_internal.h" from patch 5

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/5bpftool: Fix a leak of btf objecttools/bpf/bpftool/map.c+2 -140 replies
2/5bpftool: Fix missing BTF output for json during map dumptools/bpf/bpftool/map.c+20 -220 replies
3/5libbpf: Expose bpf_find_kernel_btf as a LIBBPF_APItools/lib/bpf/btf.c tools/lib/bpf/btf.h tools/lib/bpf/libbpf.c +1 more+102 -960 replies
4/5bpftool: Add struct_ops map nametools/bpf/bpftool/map.c+1 -00 replies
5/5bpftool: Support dumping a map with btf_vmlinux_value_type_idtools/bpf/bpftool/map.c+50 -110 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchAndrii Nakryiko
1/5A-b
2/5A-b
3/5A-b
4/5A-b
5/5A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 bpf-next 0/5] bpftool: Support dumping a map with btf_vmlinux_value_type_id

When a map is storing a kernel's struct, its map_info->btf_vmlinux_value_type_id is set. The first map type supporting it is BPF_MAP_TYPE_STRUCT_OPS.

This series adds support to dump this kind of map with BTF. The first two patches are bug fixes which are only applicable to bpf-next.

Please see individual patches for details.

v3:
- Remove unnecessary #include "libbpf_internal.h" from patch 5

v2:
- Expose bpf_find_kernel_btf() as a LIBBPF_API in patch 3 (Andrii)
- Cache btf_vmlinux in bpftool/map.c (Andrii)

Martin KaFai Lau (5):
bpftool: Fix a leak of btf object
bpftool: Fix missing BTF output for json during map dump
libbpf: Expose bpf_find_kernel_btf as a LIBBPF_API
bpftool: Add struct_ops map name
bpftool: Support dumping a map with btf_vmlinux_value_type_id

 tools/bpf/bpftool/map.c  | 102 ++++++++++++++++++++++++---------------
 tools/lib/bpf/btf.c      | 102 ++++++++++++++++++++++++++++++++++++---
 tools/lib/bpf/btf.h      |   2 +
 tools/lib/bpf/libbpf.c   |  93 ++---------------------------------
 tools/lib/bpf/libbpf.map |   1 +
 5 files changed, 166 insertions(+), 134 deletions(-)
Signature · 1 line
2.17.1