Commit 8dfbc6d1 authored by Quentin Monnet's avatar Quentin Monnet Committed by David S. Miller

tools: bpftool: show that `opcodes` or `file FILE` should be exclusive

For the `bpftool prog dump { jited | xlated } ...` command, adding
`opcodes` keyword (to request opcodes to be printed) will have no effect
if `file FILE` (to write binary output to FILE) is provided.

The manual page and the help message to be displayed in the terminal
should reflect that, and indicate that these options should be mutually
exclusive.
Signed-off-by: default avatarQuentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9e2308c1
...@@ -11,8 +11,8 @@ SYNOPSIS ...@@ -11,8 +11,8 @@ SYNOPSIS
======== ========
| **bpftool** prog show [*PROG*] | **bpftool** prog show [*PROG*]
| **bpftool** prog dump xlated *PROG* [file *FILE*] [opcodes] | **bpftool** prog dump xlated *PROG* [{file *FILE* | opcodes }]
| **bpftool** prog dump jited *PROG* [file *FILE*] [opcodes] | **bpftool** prog dump jited *PROG* [{file *FILE* | opcodes }]
| **bpftool** prog pin *PROG* *FILE* | **bpftool** prog pin *PROG* *FILE*
| **bpftool** prog help | **bpftool** prog help
| |
...@@ -28,14 +28,14 @@ DESCRIPTION ...@@ -28,14 +28,14 @@ DESCRIPTION
Output will start with program ID followed by program type and Output will start with program ID followed by program type and
zero or more named attributes (depending on kernel version). zero or more named attributes (depending on kernel version).
**bpftool prog dump xlated** *PROG* [**file** *FILE*] [**opcodes**] **bpftool prog dump xlated** *PROG* [{ **file** *FILE* | **opcodes** }]
Dump eBPF instructions of the program from the kernel. Dump eBPF instructions of the program from the kernel.
If *FILE* is specified image will be written to a file, If *FILE* is specified image will be written to a file,
otherwise it will be disassembled and printed to stdout. otherwise it will be disassembled and printed to stdout.
**opcodes** controls if raw opcodes will be printed. **opcodes** controls if raw opcodes will be printed.
**bpftool prog dump jited** *PROG* [**file** *FILE*] [**opcodes**] **bpftool prog dump jited** *PROG* [{ **file** *FILE* | **opcodes** }]
Dump jited image (host machine code) of the program. Dump jited image (host machine code) of the program.
If *FILE* is specified image will be written to a file, If *FILE* is specified image will be written to a file,
otherwise it will be disassembled and printed to stdout. otherwise it will be disassembled and printed to stdout.
......
...@@ -469,8 +469,8 @@ static int do_help(int argc, char **argv) ...@@ -469,8 +469,8 @@ static int do_help(int argc, char **argv)
{ {
fprintf(stderr, fprintf(stderr,
"Usage: %s %s show [PROG]\n" "Usage: %s %s show [PROG]\n"
" %s %s dump xlated PROG [file FILE] [opcodes]\n" " %s %s dump xlated PROG [{ file FILE | opcodes }]\n"
" %s %s dump jited PROG [file FILE] [opcodes]\n" " %s %s dump jited PROG [{ file FILE | opcodes }]\n"
" %s %s pin PROG FILE\n" " %s %s pin PROG FILE\n"
" %s %s help\n" " %s %s help\n"
"\n" "\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment