Commit 16f3ddfb authored by Quentin Monnet's avatar Quentin Monnet Committed by Alexei Starovoitov

tools: bpftool: Log info-level messages when building bpftool man pages

To build man pages for bpftool (and for eBPF helper functions), rst2man
can log different levels of information. Let's make it log all levels
to keep the RST files clean.

Doing so, rst2man complains about double colons, used for literal
blocks, that look like underlines for section titles. Let's add the
necessary blank lines.

v2:
- Use "--verbose" instead of "-r 1" (same behaviour but more readable).
- Pass it through a RST2MAN_OPTS variable so we can easily pass other
  options too.
Signed-off-by: default avatarQuentin Monnet <quentin@isovalent.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarAndrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200909162251.15498-2-quentin@isovalent.com
parent e9091bb7
...@@ -28,12 +28,13 @@ man: man8 helpers ...@@ -28,12 +28,13 @@ man: man8 helpers
man8: $(DOC_MAN8) man8: $(DOC_MAN8)
RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null) RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null)
RST2MAN_OPTS += --verbose
$(OUTPUT)%.8: %.rst $(OUTPUT)%.8: %.rst
ifndef RST2MAN_DEP ifndef RST2MAN_DEP
$(error "rst2man not found, but required to generate man pages") $(error "rst2man not found, but required to generate man pages")
endif endif
$(QUIET_GEN)rst2man $< > $@ $(QUIET_GEN)rst2man $(RST2MAN_OPTS) $< > $@
clean: helpers-clean clean: helpers-clean
$(call QUIET_CLEAN, Documentation) $(call QUIET_CLEAN, Documentation)
......
...@@ -91,6 +91,7 @@ OPTIONS ...@@ -91,6 +91,7 @@ OPTIONS
EXAMPLES EXAMPLES
======== ========
**# bpftool btf dump id 1226** **# bpftool btf dump id 1226**
:: ::
[1] PTR '(anon)' type_id=2 [1] PTR '(anon)' type_id=2
...@@ -104,6 +105,7 @@ EXAMPLES ...@@ -104,6 +105,7 @@ EXAMPLES
This gives an example of default output for all supported BTF kinds. This gives an example of default output for all supported BTF kinds.
**$ cat prog.c** **$ cat prog.c**
:: ::
struct fwd_struct; struct fwd_struct;
...@@ -144,6 +146,7 @@ This gives an example of default output for all supported BTF kinds. ...@@ -144,6 +146,7 @@ This gives an example of default output for all supported BTF kinds.
} }
**$ bpftool btf dump file prog.o** **$ bpftool btf dump file prog.o**
:: ::
[1] PTR '(anon)' type_id=2 [1] PTR '(anon)' type_id=2
......
...@@ -146,6 +146,7 @@ OPTIONS ...@@ -146,6 +146,7 @@ OPTIONS
EXAMPLES EXAMPLES
======== ========
**$ cat example.c** **$ cat example.c**
:: ::
#include <stdbool.h> #include <stdbool.h>
...@@ -187,6 +188,7 @@ This is example BPF application with two BPF programs and a mix of BPF maps ...@@ -187,6 +188,7 @@ This is example BPF application with two BPF programs and a mix of BPF maps
and global variables. and global variables.
**$ bpftool gen skeleton example.o** **$ bpftool gen skeleton example.o**
:: ::
/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
...@@ -241,6 +243,7 @@ and global variables. ...@@ -241,6 +243,7 @@ and global variables.
#endif /* __EXAMPLE_SKEL_H__ */ #endif /* __EXAMPLE_SKEL_H__ */
**$ cat example_user.c** **$ cat example_user.c**
:: ::
#include "example.skel.h" #include "example.skel.h"
...@@ -283,6 +286,7 @@ and global variables. ...@@ -283,6 +286,7 @@ and global variables.
} }
**# ./example_user** **# ./example_user**
:: ::
my_map name: my_map my_map name: my_map
......
...@@ -182,6 +182,7 @@ OPTIONS ...@@ -182,6 +182,7 @@ OPTIONS
EXAMPLES EXAMPLES
======== ========
**# bpftool map show** **# bpftool map show**
:: ::
10: hash name some_map flags 0x0 10: hash name some_map flags 0x0
...@@ -203,6 +204,7 @@ The following three commands are equivalent: ...@@ -203,6 +204,7 @@ The following three commands are equivalent:
**# bpftool map dump id 10** **# bpftool map dump id 10**
:: ::
key: 00 01 02 03 value: 00 01 02 03 04 05 06 07 key: 00 01 02 03 value: 00 01 02 03 04 05 06 07
...@@ -210,6 +212,7 @@ The following three commands are equivalent: ...@@ -210,6 +212,7 @@ The following three commands are equivalent:
Found 2 elements Found 2 elements
**# bpftool map getnext id 10 key 0 1 2 3** **# bpftool map getnext id 10 key 0 1 2 3**
:: ::
key: key:
......
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