bpftool: Support dumping a map with btf_vmlinux_value_type_id
authorMartin KaFai Lau <kafai@fb.com>
Wed, 15 Jan 2020 23:00:44 +0000 (15:00 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 15 Jan 2020 23:23:27 +0000 (15:23 -0800)
commit4e1ea33292ff2ea0a82f52b2600abb4aba752094
treedc987dca94677c0e814dc195fc76dba0ca1e446f
parent84c72ceee91c166e19b506d618dbe9df6eacce97
bpftool: Support dumping a map with btf_vmlinux_value_type_id

This patch makes bpftool support dumping a map's value properly
when the map's value type is a type of the running kernel's btf.
(i.e. map_info.btf_vmlinux_value_type_id is set instead of
map_info.btf_value_type_id).  The first usecase is for the
BPF_MAP_TYPE_STRUCT_OPS.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200115230044.1103008-1-kafai@fb.com
tools/bpf/bpftool/map.c