diff options
author | 2020-01-15 15:00:25 -0800 | |
---|---|---|
committer | 2020-01-15 15:23:27 -0800 | |
commit | 188a486619e6c9d7b8531ba6c4215b31304d293f (patch) | |
tree | 76c9146803a78148e3a9f31a8b123fec4e95965c /tools/perf/scripts/python/export-to-postgresql.py | |
parent | bpftool: Fix a leak of btf object (diff) | |
download | wireguard-linux-188a486619e6c9d7b8531ba6c4215b31304d293f.tar.xz wireguard-linux-188a486619e6c9d7b8531ba6c4215b31304d293f.zip |
bpftool: Fix missing BTF output for json during map dump
The btf availability check is only done for plain text output.
It causes the whole BTF output went missing when json_output
is used.
This patch simplifies the logic a little by avoiding passing "int btf" to
map_dump().
For plain text output, the btf_wtr is only created when the map has
BTF (i.e. info->btf_id != 0). The nullness of "json_writer_t *wtr"
in map_dump() alone can decide if dumping BTF output is needed.
As long as wtr is not NULL, map_dump() will print out the BTF-described
data whenever a map has BTF available (i.e. info->btf_id != 0)
regardless of json or plain-text output.
In do_dump(), the "int btf" is also renamed to "int do_plain_btf".
Fixes: 99f9863a0c45 ("bpftool: Match maps by name")
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Cc: Paul Chaignon <paul.chaignon@orange.com>
Link: https://lore.kernel.org/bpf/20200115230025.1101828-1-kafai@fb.com
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions