]> git.baikalelectronics.ru Git - kernel.git/commit
tools: bpftool: add JSON output for `bpftool prog show *` command
authorQuentin Monnet <quentin.monnet@netronome.com>
Mon, 23 Oct 2017 16:24:08 +0000 (09:24 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Oct 2017 00:25:08 +0000 (01:25 +0100)
commitc746145cbbf7c94a5002d6557121f435829102fd
tree1977c8d47d0674d8d1601bdc4a0252a3ab0a4936
parent847560c4dc3a342fb98acff50d4a1ddc5d3b2125
tools: bpftool: add JSON output for `bpftool prog show *` command

Reuse the json_writer API introduced in an earlier commit to make
bpftool able to generate JSON output on `bpftool prog show *` commands.

For readability, the code from show_prog() has been split into two
functions, one for plain output, one for JSON.

Outputs from sample programs have been successfully tested against a
JSON validator.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/bpf/bpftool/prog.c