All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: netdev@vger.kernel.org
Cc: oss-drivers@netronome.com,
	Quentin Monnet <quentin.monnet@netronome.com>,
	Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [PATCH net-next 7/8] tools: bpftool: show that `opcodes` or `file FILE` should be exclusive
Date: Thu, 19 Oct 2017 15:46:25 -0700	[thread overview]
Message-ID: <20171019224626.31608-8-jakub.kicinski@netronome.com> (raw)
In-Reply-To: <20171019224626.31608-1-jakub.kicinski@netronome.com>

From: Quentin Monnet <quentin.monnet@netronome.com>

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: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
 tools/bpf/bpftool/Documentation/bpftool-prog.rst | 8 ++++----
 tools/bpf/bpftool/prog.c                         | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/bpf/bpftool/Documentation/bpftool-prog.rst b/tools/bpf/bpftool/Documentation/bpftool-prog.rst
index 3968f0bd37db..69b3770370c8 100644
--- a/tools/bpf/bpftool/Documentation/bpftool-prog.rst
+++ b/tools/bpf/bpftool/Documentation/bpftool-prog.rst
@@ -11,8 +11,8 @@ SYNOPSIS
 ========
 
 |	**bpftool** prog show [*PROG*]
-|	**bpftool** prog dump xlated *PROG* [file *FILE*] [opcodes]
-|	**bpftool** prog dump jited  *PROG* [file *FILE*] [opcodes]
+|	**bpftool** prog dump xlated *PROG* [{file *FILE* | opcodes }]
+|	**bpftool** prog dump jited  *PROG* [{file *FILE* | opcodes }]
 |	**bpftool** prog pin *PROG* *FILE*
 |	**bpftool** prog help
 |
@@ -28,14 +28,14 @@ DESCRIPTION
 		  Output will start with program ID followed by program type and
 		  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.
 		  If *FILE* is specified image will be written to a file,
 		  otherwise it will be disassembled and printed to stdout.
 
 		  **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.
 		  If *FILE* is specified image will be written to a file,
 		  otherwise it will be disassembled and printed to stdout.
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index 57edbea2fbe8..7838206a455b 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -469,8 +469,8 @@ static int do_help(int argc, char **argv)
 {
 	fprintf(stderr,
 		"Usage: %s %s show [PROG]\n"
-		"       %s %s dump xlated PROG [file FILE] [opcodes]\n"
-		"       %s %s dump jited  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 pin   PROG FILE\n"
 		"       %s %s help\n"
 		"\n"
-- 
2.14.1

  parent reply	other threads:[~2017-10-19 22:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 22:46 [PATCH net-next 0/8] tools: bpftool: add a "version" command, and fix several items Jakub Kicinski
2017-10-19 22:46 ` [PATCH net-next 1/8] tools: bpftool: add pointer to file argument to print_hex() Jakub Kicinski
2017-10-20 10:55   ` Daniel Borkmann
2017-10-19 22:46 ` [PATCH net-next 2/8] tools: bpftool: fix return value when all eBPF programs have been shown Jakub Kicinski
2017-10-20 10:55   ` Daniel Borkmann
2017-10-19 22:46 ` [PATCH net-next 3/8] tools: bpftool: use err() instead of info() if there are too many insns Jakub Kicinski
2017-10-20 10:55   ` Daniel Borkmann
2017-10-19 22:46 ` [PATCH net-next 4/8] tools: bpftool: add `bpftool prog help` as real command i.r.t exit code Jakub Kicinski
2017-10-20 10:56   ` Daniel Borkmann
2017-10-19 22:46 ` [PATCH net-next 5/8] tools: bpftool: print only one error message on byte parsing failure Jakub Kicinski
2017-10-20 10:56   ` Daniel Borkmann
2017-10-19 22:46 ` [PATCH net-next 6/8] tools: bpftool: print all relevant byte opcodes for "load double word" Jakub Kicinski
2017-10-20  9:59   ` David Laight
2017-10-20 15:50     ` Quentin Monnet
2017-10-20 16:12       ` Daniel Borkmann
2017-10-20 16:41         ` Quentin Monnet
2017-10-20 10:56   ` Daniel Borkmann
2017-10-19 22:46 ` Jakub Kicinski [this message]
2017-10-20 10:56   ` [PATCH net-next 7/8] tools: bpftool: show that `opcodes` or `file FILE` should be exclusive Daniel Borkmann
2017-10-19 22:46 ` [PATCH net-next 8/8] tools: bpftool: add a command to display bpftool version Jakub Kicinski
2017-10-20 10:57   ` Daniel Borkmann
2017-10-19 23:42 ` [PATCH net-next 0/8] tools: bpftool: add a "version" command, and fix several items Alexei Starovoitov
2017-10-22  1:11 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171019224626.31608-8-jakub.kicinski@netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=quentin.monnet@netronome.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.