diff options
| author | Quentin Monnet <[email protected]> | 2018-12-05 10:28:24 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2018-12-05 16:41:52 +0100 |
| commit | 30da46b5dc3a9a14db11706d841440e28b12bb53 (patch) | |
| tree | 32ed4dde5cbce0f5ec6cdba14b33ef245de2579a /tools/bpf/bpftool/bash-completion | |
| parent | 41888179b1b7d0524314758ce1ad7c2e3b602235 (diff) | |
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 <[email protected]>
Suggested-by: Daniel Borkmann <[email protected]>
Signed-off-by: Quentin Monnet <[email protected]>
Reviewed-by: Jakub Kicinski <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Diffstat (limited to 'tools/bpf/bpftool/bash-completion')
| -rw-r--r-- | tools/bpf/bpftool/bash-completion/bpftool | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftool/bash-completion/bpftool index 9a60080f085f..44c189ba072a 100644 --- a/tools/bpf/bpftool/bash-completion/bpftool +++ b/tools/bpf/bpftool/bash-completion/bpftool @@ -398,10 +398,13 @@ _bpftool() ;; esac ;; + tracelog) + return 0 + ;; *) [[ $prev == $object ]] && \ COMPREPLY=( $( compgen -W 'dump help pin attach detach load \ - show list' -- "$cur" ) ) + show list tracelog' -- "$cur" ) ) ;; esac ;; |