Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 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/20200909162251.15498-2-quentin@isovalent.com

authored by

Quentin Monnet and committed by
Alexei Starovoitov
16f3ddfb e9091bb7

+12 -1
+2 -1
tools/bpf/bpftool/Documentation/Makefile
··· 28 28 man8: $(DOC_MAN8) 29 29 30 30 RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null) 31 + RST2MAN_OPTS += --verbose 31 32 32 33 $(OUTPUT)%.8: %.rst 33 34 ifndef RST2MAN_DEP 34 35 $(error "rst2man not found, but required to generate man pages") 35 36 endif 36 - $(QUIET_GEN)rst2man $< > $@ 37 + $(QUIET_GEN)rst2man $(RST2MAN_OPTS) $< > $@ 37 38 38 39 clean: helpers-clean 39 40 $(call QUIET_CLEAN, Documentation)
+3
tools/bpf/bpftool/Documentation/bpftool-btf.rst
··· 91 91 EXAMPLES 92 92 ======== 93 93 **# bpftool btf dump id 1226** 94 + 94 95 :: 95 96 96 97 [1] PTR '(anon)' type_id=2 ··· 105 104 This gives an example of default output for all supported BTF kinds. 106 105 107 106 **$ cat prog.c** 107 + 108 108 :: 109 109 110 110 struct fwd_struct; ··· 146 144 } 147 145 148 146 **$ bpftool btf dump file prog.o** 147 + 149 148 :: 150 149 151 150 [1] PTR '(anon)' type_id=2
+4
tools/bpf/bpftool/Documentation/bpftool-gen.rst
··· 146 146 EXAMPLES 147 147 ======== 148 148 **$ cat example.c** 149 + 149 150 :: 150 151 151 152 #include <stdbool.h> ··· 188 187 and global variables. 189 188 190 189 **$ bpftool gen skeleton example.o** 190 + 191 191 :: 192 192 193 193 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ ··· 243 241 #endif /* __EXAMPLE_SKEL_H__ */ 244 242 245 243 **$ cat example_user.c** 244 + 246 245 :: 247 246 248 247 #include "example.skel.h" ··· 286 283 } 287 284 288 285 **# ./example_user** 286 + 289 287 :: 290 288 291 289 my_map name: my_map
+3
tools/bpf/bpftool/Documentation/bpftool-map.rst
··· 182 182 EXAMPLES 183 183 ======== 184 184 **# bpftool map show** 185 + 185 186 :: 186 187 187 188 10: hash name some_map flags 0x0 ··· 204 203 205 204 206 205 **# bpftool map dump id 10** 206 + 207 207 :: 208 208 209 209 key: 00 01 02 03 value: 00 01 02 03 04 05 06 07 ··· 212 210 Found 2 elements 213 211 214 212 **# bpftool map getnext id 10 key 0 1 2 3** 213 + 215 214 :: 216 215 217 216 key: