diff options
author | Yonghong Song <yhs@fb.com> | 2019-02-01 16:14:15 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-02-04 09:40:58 -0800 |
commit | 9d100a19ffa519b17a0e998918337da5386e47fb (patch) | |
tree | 33ba27812e8abc05913c8f57b654e30f1e1e1cd6 /tools/lib/bpf/libbpf_util.h | |
parent | 8461ef8b7ef286212ca954d8b82dac3ceecb219d (diff) | |
download | linux-9d100a19ffa519b17a0e998918337da5386e47fb.tar.bz2 |
tools/bpf: print out btf log at LIBBPF_WARN level
Currently, the btf log is allocated and printed out in case
of error at LIBBPF_DEBUG level.
Such logs from kernel are very important for debugging.
For example, bpf syscall BPF_PROG_LOAD command can get
verifier logs back to user space. In function load_program()
of libbpf.c, the log buffer is allocated unconditionally
and printed out at pr_warning() level.
Let us do the similar thing here for btf. Allocate buffer
unconditionally and print out error logs at pr_warning() level.
This can reduce one global function and
optimize for common situations where pr_warning()
is activated either by default or by user supplied
debug output function.
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/libbpf_util.h')
-rw-r--r-- | tools/lib/bpf/libbpf_util.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/tools/lib/bpf/libbpf_util.h b/tools/lib/bpf/libbpf_util.h index 0fdc3b1d0e33..81ecda0cb9c9 100644 --- a/tools/lib/bpf/libbpf_util.h +++ b/tools/lib/bpf/libbpf_util.h @@ -14,8 +14,6 @@ extern void libbpf_print(enum libbpf_print_level level, const char *format, ...) __attribute__((format(printf, 2, 3))); -extern bool libbpf_print_level_available(enum libbpf_print_level level); - #define __pr(level, fmt, ...) \ do { \ libbpf_print(level, "libbpf: " fmt, ##__VA_ARGS__); \ |