]> git.baikalelectronics.ru Git - kernel.git/commit
tools: bpftool: preserve JSON for batch mode when dumping insns to file
authorQuentin Monnet <quentin.monnet@netronome.com>
Thu, 15 Feb 2018 06:42:54 +0000 (22:42 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 15 Feb 2018 09:01:05 +0000 (10:01 +0100)
commit01c1808f0505cef1a9d2c0c7d73281d00057383a
tree52b4b6401eba46301f0bb23e0dc26af753f8e278
parentdc4a0de238ecb08dfa8908762cd5aa0f8822b346
tools: bpftool: preserve JSON for batch mode when dumping insns to file

Print a "null" JSON object to standard output when bpftool is used to
print program instructions to a file, so as to avoid breaking JSON
output on batch mode.

This null object was added for most commands in a previous commit, but
this specific case had been omitted.

Fixes: d19ce01d5f62 ("tools: bpftool: provide JSON output for all possible commands")
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/bpf/bpftool/prog.c