diff options
author | Martin KaFai Lau <[email protected]> | 2020-01-15 15:00:25 -0800 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2020-01-15 15:23:27 -0800 |
commit | 188a486619e6c9d7b8531ba6c4215b31304d293f (patch) | |
tree | 76c9146803a78148e3a9f31a8b123fec4e95965c /drivers/usb/cdns3/cdns3-debug.h | |
parent | d7de72674af53c3839eff091899f18c221dd30d2 (diff) |
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 <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Cc: Paul Chaignon <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'drivers/usb/cdns3/cdns3-debug.h')
0 files changed, 0 insertions, 0 deletions