summaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/Documentation/bpftool.rst
diff options
context:
space:
mode:
authorQuentin Monnet2019-05-24 12:36:48 +0200
committerDaniel Borkmann2019-05-28 11:03:26 +0200
commit55d778076b0354b088a9a16d9ff584c887e17f42 (patch)
treee1e2228930b3fa7c18dcc998dde0739115fc1e4d /tools/bpf/bpftool/Documentation/bpftool.rst
parentlibbpf: add bpf_object__load_xattr() API function to pass log_level (diff)
downloadkernel-qcow2-linux-55d778076b0354b088a9a16d9ff584c887e17f42.tar.gz
kernel-qcow2-linux-55d778076b0354b088a9a16d9ff584c887e17f42.tar.xz
kernel-qcow2-linux-55d778076b0354b088a9a16d9ff584c887e17f42.zip
tools: bpftool: make -d option print debug output from verifier
The "-d" option is used to require all logs available for bpftool. So far it meant telling libbpf to print even debug-level information. But there is another source of info that can be made more verbose: when we attemt to load programs with bpftool, we can pass a log_level parameter to the verifier in order to control the amount of information that is printed to the console. Reuse the "-d" option to print all information the verifier can tell. At this time, this means logs related to BPF_LOG_LEVEL1, BPF_LOG_LEVEL2 and BPF_LOG_STATS. As mentioned in the discussion on the first version of this set, these macros are internal to the kernel (include/linux/bpf_verifier.h) and are not meant to be part of the stable user API, therefore we simply use the related constants to print whatever we can at this time, without trying to tell users what is log_level1 or what is statistics. Verifier logs are only used when loading programs for now (In the future: for loading BTF objects with bpftool? Although libbpf does not currently offer to print verifier info at debug level if no error occurred when loading BTF objects), so bpftool.rst and bpftool-prog.rst are the only man pages to get the update. v3: - Add details on log level and BTF loading at the end of commit log. v2: - Remove the possibility to select the log levels to use (v1 offered a combination of "log_level1", "log_level2" and "stats"). - The macros from kernel header bpf_verifier.h are not used (and therefore not moved to UAPI header). - In v1 this was a distinct option, but is now merged in the only "-d" switch to activate libbpf and verifier debug-level logs all at the same time. Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/bpf/bpftool/Documentation/bpftool.rst')
-rw-r--r--tools/bpf/bpftool/Documentation/bpftool.rst5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/bpf/bpftool/Documentation/bpftool.rst b/tools/bpf/bpftool/Documentation/bpftool.rst
index 43dba0717953..6a9c52ef84a9 100644
--- a/tools/bpf/bpftool/Documentation/bpftool.rst
+++ b/tools/bpf/bpftool/Documentation/bpftool.rst
@@ -67,8 +67,9 @@ OPTIONS
(such as tracefs or BPF virtual file system) when necessary.
-d, --debug
- Print all logs available from libbpf, including debug-level
- information.
+ 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
========