summaryrefslogtreecommitdiff
path: root/tools/bpf/bpftool/main.h
diff options
context:
space:
mode:
authorQuentin Monnet <quentin.monnet@netronome.com>2018-12-05 10:28:24 +0000
committerDaniel Borkmann <daniel@iogearbox.net>2018-12-05 16:41:52 +0100
commit30da46b5dc3a9a14db11706d841440e28b12bb53 (patch)
tree32ed4dde5cbce0f5ec6cdba14b33ef245de2579a /tools/bpf/bpftool/main.h
parent41888179b1b7d0524314758ce1ad7c2e3b602235 (diff)
downloadlwn-30da46b5dc3a9a14db11706d841440e28b12bb53.tar.gz
lwn-30da46b5dc3a9a14db11706d841440e28b12bb53.zip
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>
Diffstat (limited to 'tools/bpf/bpftool/main.h')
-rw-r--r--tools/bpf/bpftool/main.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/bpf/bpftool/main.h b/tools/bpf/bpftool/main.h
index 2761981669c8..0be0dd8f467f 100644
--- a/tools/bpf/bpftool/main.h
+++ b/tools/bpf/bpftool/main.h
@@ -167,6 +167,7 @@ int do_event_pipe(int argc, char **argv);
int do_cgroup(int argc, char **arg);
int do_perf(int argc, char **arg);
int do_net(int argc, char **arg);
+int do_tracelog(int argc, char **arg);
int parse_u32_arg(int *argc, char ***argv, __u32 *val, const char *what);
int prog_parse_fd(int *argc, char ***argv);