[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-wi44iid0yjfht3lcvplc75fm@git.kernel.org>
Date: Thu, 2 Aug 2018 01:16:17 -0700
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: namhyung@...nel.org, wangnan0@...wei.com, mingo@...nel.org,
tglx@...utronix.de, linux-kernel@...r.kernel.org, hpa@...or.com,
acme@...hat.com, dsahern@...il.com, adrian.hunter@...el.com,
jolsa@...nel.org
Subject: [tip:perf/core] perf bpf: Show better message when failing to load
an object
Commit-ID: 739e2edc848af30fefa66d6c422c00ca9a701c06
Gitweb: https://git.kernel.org/tip/739e2edc848af30fefa66d6c422c00ca9a701c06
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Tue, 31 Jul 2018 11:58:57 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 31 Jul 2018 11:58:57 -0300
perf bpf: Show better message when failing to load an object
Before:
libbpf: license of tools/perf/examples/bpf/etcsnoop.c is GPL
libbpf: section(6) version, size 4, link 0, flags 3, type=1
libbpf: kernel version of tools/perf/examples/bpf/etcsnoop.c is 41200
libbpf: section(7) .symtab, size 120, link 1, flags 0, type=2
bpf: config program 'syscalls:sys_enter_openat'
libbpf: load bpf program failed: Operation not permitted
libbpf: failed to load program 'syscalls:sys_enter_openat'
libbpf: failed to load object 'tools/perf/examples/bpf/etcsnoop.c'
bpf: load objects failed
After: (just the last line changes)
bpf: load objects failed: err=-4009: (Incorrect kernel version)
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: https://lkml.kernel.org/n/tip-wi44iid0yjfht3lcvplc75fm@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/bpf-loader.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index cee658733e2c..3d02ae38ec56 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -747,7 +747,9 @@ int bpf__load(struct bpf_object *obj)
err = bpf_object__load(obj);
if (err) {
- pr_debug("bpf: load objects failed\n");
+ char bf[128];
+ libbpf_strerror(err, bf, sizeof(bf));
+ pr_debug("bpf: load objects failed: err=%d: (%s)\n", err, bf);
return err;
}
return 0;
Powered by blists - more mailing lists