]> git.baikalelectronics.ru Git - kernel.git/commit
tools: bpftool: add a command to dump the trace pipe
authorQuentin Monnet <quentin.monnet@netronome.com>
Wed, 5 Dec 2018 10:28:24 +0000 (10:28 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 5 Dec 2018 15:41:52 +0000 (16:41 +0100)
commitd3b92d731c0da684ff351343a57dbba6287602f5
tree32ed4dde5cbce0f5ec6cdba14b33ef245de2579a
parent91252fa3677066a461f5dfa646b098d1bf60a652
tools: bpftool: add a command to dump the trace pipe

BPF programs can use the bpf_trace_printk() helper to print debug
information into the trace pipe. Add a subcommand
"bpftool prog tracelog" to simply dump this pipe to the console.

This is for a good part copied from iproute2, where the feature is
available with "tc exec bpf dbg". Changes include dumping pipe content
to stdout instead of stderr and adding JSON support (content is dumped
as an array of strings, one per line read from the pipe). This version
is dual-licensed, with Daniel's permission.

Cc: Daniel Borkmann <daniel@iogearbox.net>
Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/bpf/bpftool/Documentation/bpftool-prog.rst
tools/bpf/bpftool/bash-completion/bpftool
tools/bpf/bpftool/main.h
tools/bpf/bpftool/prog.c
tools/bpf/bpftool/tracelog.c [new file with mode: 0644]