diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index 846d2e5c64b4..10b6c9d3e525 100644 --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c @@ -531,6 +531,9 @@ static int show_map_close_json(int fd, struct bpf_map_info *info) } close(fd); + if (info->btf_id) + jsonw_int_field(json_wtr, "btf_id", info->btf_id); + if (!hash_empty(map_table.table)) { struct pinned_obj *obj; @@ -606,6 +609,9 @@ static int show_map_close_plain(int fd, struct bpf_map_info *info) } } + if (info->btf_id) + printf("\n\tbtf_id %d", info->btf_id); + printf("\n"); return 0; }