mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 04:31:50 +00:00
tools: bpftool: Include common options from separate file
Nearly all man pages for bpftool have the same common set of option flags (--help, --version, --json, --pretty, --debug). The description is duplicated across all the pages, which is more difficult to maintain if the description of an option changes. It may also be confusing to sort out what options are not "common" and should not be copied when creating new manual pages. Let's move the description for those common options to a separate file, which is included with a RST directive when generating the man pages. Signed-off-by: Quentin Monnet <quentin@isovalent.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/bpf/20200909162500.17010-3-quentin@isovalent.com
This commit is contained in:
parent
82b8cf0acc
commit
f28ef96d7b
@ -19,7 +19,7 @@ man8dir = $(mandir)/man8
|
|||||||
# Load targets for building eBPF helpers man page.
|
# Load targets for building eBPF helpers man page.
|
||||||
include ../../Makefile.helpers
|
include ../../Makefile.helpers
|
||||||
|
|
||||||
MAN8_RST = $(filter-out $(HELPERS_RST),$(wildcard *.rst))
|
MAN8_RST = $(wildcard bpftool*.rst)
|
||||||
|
|
||||||
_DOC_MAN8 = $(patsubst %.rst,%.8,$(MAN8_RST))
|
_DOC_MAN8 = $(patsubst %.rst,%.8,$(MAN8_RST))
|
||||||
DOC_MAN8 = $(addprefix $(OUTPUT),$(_DOC_MAN8))
|
DOC_MAN8 = $(addprefix $(OUTPUT),$(_DOC_MAN8))
|
||||||
|
@ -71,22 +71,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
=======
|
=======
|
||||||
-h, --help
|
.. include:: common_options.rst
|
||||||
Print short generic help message (similar to **bpftool help**).
|
|
||||||
|
|
||||||
-V, --version
|
|
||||||
Print version number (similar to **bpftool version**).
|
|
||||||
|
|
||||||
-j, --json
|
|
||||||
Generate JSON output. For commands that cannot produce JSON, this
|
|
||||||
option has no effect.
|
|
||||||
|
|
||||||
-p, --pretty
|
|
||||||
Generate human-readable JSON output. Implies **-j**.
|
|
||||||
|
|
||||||
-d, --debug
|
|
||||||
Print all logs available from libbpf, including debug-level
|
|
||||||
information.
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
========
|
========
|
||||||
|
@ -116,26 +116,11 @@ DESCRIPTION
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
=======
|
=======
|
||||||
-h, --help
|
.. include:: common_options.rst
|
||||||
Print short generic help message (similar to **bpftool help**).
|
|
||||||
|
|
||||||
-V, --version
|
|
||||||
Print version number (similar to **bpftool version**).
|
|
||||||
|
|
||||||
-j, --json
|
|
||||||
Generate JSON output. For commands that cannot produce JSON, this
|
|
||||||
option has no effect.
|
|
||||||
|
|
||||||
-p, --pretty
|
|
||||||
Generate human-readable JSON output. Implies **-j**.
|
|
||||||
|
|
||||||
-f, --bpffs
|
-f, --bpffs
|
||||||
Show file names of pinned programs.
|
Show file names of pinned programs.
|
||||||
|
|
||||||
-d, --debug
|
|
||||||
Print all logs available from libbpf, including debug-level
|
|
||||||
information.
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
========
|
========
|
||||||
|
|
|
|
||||||
|
@ -71,22 +71,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
=======
|
=======
|
||||||
-h, --help
|
.. include:: common_options.rst
|
||||||
Print short generic help message (similar to **bpftool help**).
|
|
||||||
|
|
||||||
-V, --version
|
|
||||||
Print version number (similar to **bpftool version**).
|
|
||||||
|
|
||||||
-j, --json
|
|
||||||
Generate JSON output. For commands that cannot produce JSON, this
|
|
||||||
option has no effect.
|
|
||||||
|
|
||||||
-p, --pretty
|
|
||||||
Generate human-readable JSON output. Implies **-j**.
|
|
||||||
|
|
||||||
-d, --debug
|
|
||||||
Print all logs available from libbpf, including debug-level
|
|
||||||
information.
|
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
========
|
========
|
||||||
|
@ -126,22 +126,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
=======
|
=======
|
||||||
-h, --help
|
.. include:: common_options.rst
|
||||||
Print short generic help message (similar to **bpftool help**).
|
|
||||||
|
|
||||||
-V, --version
|
|
||||||
Print version number (similar to **bpftool version**).
|
|
||||||
|
|
||||||
-j, --json
|
|
||||||
Generate JSON output. For commands that cannot produce JSON,
|
|
||||||
this option has no effect.
|
|
||||||
|
|
||||||
-p, --pretty
|
|
||||||
Generate human-readable JSON output. Implies **-j**.
|
|
||||||
|
|
||||||
-d, --debug
|
|
||||||
Print all logs available from libbpf, including debug-level
|
|
||||||
information.
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
========
|
========
|
||||||
|
@ -51,16 +51,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
=======
|
=======
|
||||||
-h, --help
|
.. include:: common_options.rst
|
||||||
Print short generic help message (similar to **bpftool help**).
|
|
||||||
|
|
||||||
-V, --version
|
|
||||||
Print version number (similar to **bpftool version**).
|
|
||||||
|
|
||||||
-d, --debug
|
|
||||||
Print all logs available, even debug-level information. This
|
|
||||||
includes logs from libbpf as well as from the verifier, when
|
|
||||||
attempting to load programs.
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
========
|
========
|
||||||
|
@ -62,18 +62,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
=======
|
=======
|
||||||
-h, --help
|
.. include:: common_options.rst
|
||||||
Print short generic help message (similar to **bpftool help**).
|
|
||||||
|
|
||||||
-V, --version
|
|
||||||
Print version number (similar to **bpftool version**).
|
|
||||||
|
|
||||||
-j, --json
|
|
||||||
Generate JSON output. For commands that cannot produce JSON, this
|
|
||||||
option has no effect.
|
|
||||||
|
|
||||||
-p, --pretty
|
|
||||||
Generate human-readable JSON output. Implies **-j**.
|
|
||||||
|
|
||||||
-f, --bpffs
|
-f, --bpffs
|
||||||
When showing BPF links, show file names of pinned
|
When showing BPF links, show file names of pinned
|
||||||
@ -83,10 +72,6 @@ OPTIONS
|
|||||||
Do not automatically attempt to mount any virtual file system
|
Do not automatically attempt to mount any virtual file system
|
||||||
(such as tracefs or BPF virtual file system) when necessary.
|
(such as tracefs or BPF virtual file system) when necessary.
|
||||||
|
|
||||||
-d, --debug
|
|
||||||
Print all logs available, even debug-level information. This
|
|
||||||
includes logs from libbpf.
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
========
|
========
|
||||||
**# bpftool link show**
|
**# bpftool link show**
|
||||||
|
@ -155,18 +155,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
=======
|
=======
|
||||||
-h, --help
|
.. include:: common_options.rst
|
||||||
Print short generic help message (similar to **bpftool help**).
|
|
||||||
|
|
||||||
-V, --version
|
|
||||||
Print version number (similar to **bpftool version**).
|
|
||||||
|
|
||||||
-j, --json
|
|
||||||
Generate JSON output. For commands that cannot produce JSON, this
|
|
||||||
option has no effect.
|
|
||||||
|
|
||||||
-p, --pretty
|
|
||||||
Generate human-readable JSON output. Implies **-j**.
|
|
||||||
|
|
||||||
-f, --bpffs
|
-f, --bpffs
|
||||||
Show file names of pinned maps.
|
Show file names of pinned maps.
|
||||||
@ -175,10 +164,6 @@ OPTIONS
|
|||||||
Do not automatically attempt to mount any virtual file system
|
Do not automatically attempt to mount any virtual file system
|
||||||
(such as tracefs or BPF virtual file system) when necessary.
|
(such as tracefs or BPF virtual file system) when necessary.
|
||||||
|
|
||||||
-d, --debug
|
|
||||||
Print all logs available from libbpf, including debug-level
|
|
||||||
information.
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
========
|
========
|
||||||
**# bpftool map show**
|
**# bpftool map show**
|
||||||
|
@ -75,22 +75,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
=======
|
=======
|
||||||
-h, --help
|
.. include:: common_options.rst
|
||||||
Print short generic help message (similar to **bpftool help**).
|
|
||||||
|
|
||||||
-V, --version
|
|
||||||
Print version number (similar to **bpftool version**).
|
|
||||||
|
|
||||||
-j, --json
|
|
||||||
Generate JSON output. For commands that cannot produce JSON, this
|
|
||||||
option has no effect.
|
|
||||||
|
|
||||||
-p, --pretty
|
|
||||||
Generate human-readable JSON output. Implies **-j**.
|
|
||||||
|
|
||||||
-d, --debug
|
|
||||||
Print all logs available from libbpf, including debug-level
|
|
||||||
information.
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
========
|
========
|
||||||
|
@ -40,22 +40,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
=======
|
=======
|
||||||
-h, --help
|
.. include:: common_options.rst
|
||||||
Print short generic help message (similar to **bpftool help**).
|
|
||||||
|
|
||||||
-V, --version
|
|
||||||
Print version number (similar to **bpftool version**).
|
|
||||||
|
|
||||||
-j, --json
|
|
||||||
Generate JSON output. For commands that cannot produce JSON, this
|
|
||||||
option has no effect.
|
|
||||||
|
|
||||||
-p, --pretty
|
|
||||||
Generate human-readable JSON output. Implies **-j**.
|
|
||||||
|
|
||||||
-d, --debug
|
|
||||||
Print all logs available from libbpf, including debug-level
|
|
||||||
information.
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
========
|
========
|
||||||
|
@ -210,18 +210,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
=======
|
=======
|
||||||
-h, --help
|
.. include:: common_options.rst
|
||||||
Print short generic help message (similar to **bpftool help**).
|
|
||||||
|
|
||||||
-V, --version
|
|
||||||
Print version number (similar to **bpftool version**).
|
|
||||||
|
|
||||||
-j, --json
|
|
||||||
Generate JSON output. For commands that cannot produce JSON, this
|
|
||||||
option has no effect.
|
|
||||||
|
|
||||||
-p, --pretty
|
|
||||||
Generate human-readable JSON output. Implies **-j**.
|
|
||||||
|
|
||||||
-f, --bpffs
|
-f, --bpffs
|
||||||
When showing BPF programs, show file names of pinned
|
When showing BPF programs, show file names of pinned
|
||||||
@ -234,11 +223,6 @@ OPTIONS
|
|||||||
Do not automatically attempt to mount any virtual file system
|
Do not automatically attempt to mount any virtual file system
|
||||||
(such as tracefs or BPF virtual file system) when necessary.
|
(such as tracefs or BPF virtual file system) when necessary.
|
||||||
|
|
||||||
-d, --debug
|
|
||||||
Print all logs available, even debug-level information. This
|
|
||||||
includes logs from libbpf as well as from the verifier, when
|
|
||||||
attempting to load programs.
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
========
|
========
|
||||||
**# bpftool prog show**
|
**# bpftool prog show**
|
||||||
|
@ -60,23 +60,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
=======
|
=======
|
||||||
-h, --help
|
.. include:: common_options.rst
|
||||||
Print short generic help message (similar to **bpftool help**).
|
|
||||||
|
|
||||||
-V, --version
|
|
||||||
Print version number (similar to **bpftool version**).
|
|
||||||
|
|
||||||
-j, --json
|
|
||||||
Generate JSON output. For commands that cannot produce JSON, this
|
|
||||||
option has no effect.
|
|
||||||
|
|
||||||
-p, --pretty
|
|
||||||
Generate human-readable JSON output. Implies **-j**.
|
|
||||||
|
|
||||||
-d, --debug
|
|
||||||
Print all logs available, even debug-level information. This
|
|
||||||
includes logs from libbpf as well as from the verifier, when
|
|
||||||
attempting to load programs.
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
========
|
========
|
||||||
|
@ -46,24 +46,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
=======
|
=======
|
||||||
-h, --help
|
.. include:: common_options.rst
|
||||||
Print short help message (similar to **bpftool help**).
|
|
||||||
|
|
||||||
-V, --version
|
|
||||||
Print version number (similar to **bpftool version**), and
|
|
||||||
optional features that were included when bpftool was
|
|
||||||
compiled. Optional features include linking against libbfd to
|
|
||||||
provide the disassembler for JIT-ted programs (**bpftool prog
|
|
||||||
dump jited**) and usage of BPF skeletons (some features like
|
|
||||||
**bpftool prog profile** or showing pids associated to BPF
|
|
||||||
objects may rely on it).
|
|
||||||
|
|
||||||
-j, --json
|
|
||||||
Generate JSON output. For commands that cannot produce JSON, this
|
|
||||||
option has no effect.
|
|
||||||
|
|
||||||
-p, --pretty
|
|
||||||
Generate human-readable JSON output. Implies **-j**.
|
|
||||||
|
|
||||||
-m, --mapcompat
|
-m, --mapcompat
|
||||||
Allow loading maps with unknown map definitions.
|
Allow loading maps with unknown map definitions.
|
||||||
@ -72,11 +55,6 @@ OPTIONS
|
|||||||
Do not automatically attempt to mount any virtual file system
|
Do not automatically attempt to mount any virtual file system
|
||||||
(such as tracefs or BPF virtual file system) when necessary.
|
(such as tracefs or BPF virtual file system) when necessary.
|
||||||
|
|
||||||
-d, --debug
|
|
||||||
Print all logs available, even debug-level information. This
|
|
||||||
includes logs from libbpf as well as from the verifier, when
|
|
||||||
attempting to load programs.
|
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
========
|
========
|
||||||
**bpf**\ (2),
|
**bpf**\ (2),
|
||||||
|
22
tools/bpf/bpftool/Documentation/common_options.rst
Normal file
22
tools/bpf/bpftool/Documentation/common_options.rst
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
-h, --help
|
||||||
|
Print short help message (similar to **bpftool help**).
|
||||||
|
|
||||||
|
-V, --version
|
||||||
|
Print version number (similar to **bpftool version**), and optional
|
||||||
|
features that were included when bpftool was compiled. Optional
|
||||||
|
features include linking against libbfd to provide the disassembler
|
||||||
|
for JIT-ted programs (**bpftool prog dump jited**) and usage of BPF
|
||||||
|
skeletons (some features like **bpftool prog profile** or showing
|
||||||
|
pids associated to BPF objects may rely on it).
|
||||||
|
|
||||||
|
-j, --json
|
||||||
|
Generate JSON output. For commands that cannot produce JSON, this
|
||||||
|
option has no effect.
|
||||||
|
|
||||||
|
-p, --pretty
|
||||||
|
Generate human-readable JSON output. Implies **-j**.
|
||||||
|
|
||||||
|
-d, --debug
|
||||||
|
Print all logs available, even debug-level information. This includes
|
||||||
|
logs from libbpf as well as from the verifier, when attempting to
|
||||||
|
load programs.
|
Loading…
Reference in New Issue
Block a user