summaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/btf.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/bpf/btf.c')
-rw-r--r--tools/lib/bpf/btf.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index 93e792b82242..51a0db05bf80 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -377,16 +377,15 @@ struct btf *btf__new(__u8 *data, __u32 size)
btf->fd = -1;
- if (libbpf_print_level_available(LIBBPF_DEBUG)) {
- log_buf = malloc(BPF_LOG_BUF_SIZE);
- if (!log_buf) {
- err = -ENOMEM;
- goto done;
- }
- *log_buf = 0;
- log_buf_size = BPF_LOG_BUF_SIZE;
+ log_buf = malloc(BPF_LOG_BUF_SIZE);
+ if (!log_buf) {
+ err = -ENOMEM;
+ goto done;
}
+ *log_buf = 0;
+ log_buf_size = BPF_LOG_BUF_SIZE;
+
btf->data = malloc(size);
if (!btf->data) {
err = -ENOMEM;
@@ -401,9 +400,9 @@ struct btf *btf__new(__u8 *data, __u32 size)
if (btf->fd == -1) {
err = -errno;
- pr_debug("Error loading BTF: %s(%d)\n", strerror(errno), errno);
+ pr_warning("Error loading BTF: %s(%d)\n", strerror(errno), errno);
if (log_buf && *log_buf)
- pr_debug("%s\n", log_buf);
+ pr_warning("%s\n", log_buf);
goto done;
}