]> git.baikalelectronics.ru Git - kernel.git/commit
tools/bpf: print out btf log at LIBBPF_WARN level
authorYonghong Song <yhs@fb.com>
Sat, 2 Feb 2019 00:14:15 +0000 (16:14 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 4 Feb 2019 17:40:58 +0000 (09:40 -0800)
commit9963de740725635c327194ebe8a8a3a50a19e496
tree33ba27812e8abc05913c8f57b654e30f1e1e1cd6
parent4c06c74e0f50d0f89df4bb5645d95b5ede4529cd
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>
tools/lib/bpf/btf.c
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf_util.h