]> git.baikalelectronics.ru Git - kernel.git/commit
bpftool: Fix pretty print dump for maps without BTF loaded
authorJiri Olsa <jolsa@kernel.org>
Wed, 16 Feb 2022 09:21:02 +0000 (10:21 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 16 Feb 2022 23:08:55 +0000 (15:08 -0800)
commite0f8bfd904feda3a8b72430b859e0a4950e1d39c
treeafda4ed5f257e0e51fb28a06551b4a4ef5f8a770
parentab5eb5b8c2818bd2d9588d519748a6ab20b33ce6
bpftool: Fix pretty print dump for maps without BTF loaded

The commit 15b0c9286085 ("bpftool: Use libbpf_get_error() to check error")
fails to dump map without BTF loaded in pretty mode (-p option).

Fixing this by making sure get_map_kv_btf won't fail in case there's
no BTF available for the map.

Fixes: 15b0c9286085 ("bpftool: Use libbpf_get_error() to check error")
Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220216092102.125448-1-jolsa@kernel.org
tools/bpf/bpftool/map.c