diff options
author | Stanislav Fomichev | 2019-05-15 05:38:49 +0200 |
---|---|---|
committer | Daniel Borkmann | 2019-05-16 01:32:19 +0200 |
commit | 15ea164ef11abc0a2d3001ca40e5e509cd06091f (patch) | |
tree | 07afe108034d75851b88732cafebbbfd2910c752 /tools/lib | |
parent | Merge branch 'lru-map-fix' (diff) | |
download | kernel-qcow2-linux-15ea164ef11abc0a2d3001ca40e5e509cd06091f.tar.gz kernel-qcow2-linux-15ea164ef11abc0a2d3001ca40e5e509cd06091f.tar.xz kernel-qcow2-linux-15ea164ef11abc0a2d3001ca40e5e509cd06091f.zip |
libbpf: don't fail when feature probing fails
Otherwise libbpf is unusable from unprivileged process with
kernel.kernel.unprivileged_bpf_disabled=1.
All I get is EPERM from the probes, even if I just want to
open an ELF object and look at what progs/maps it has.
Instead of dying on probes, let's just pr_debug the error and
try to continue.
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/bpf/libbpf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 7e3b79d7c25f..3562b6ef5fdc 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -1696,7 +1696,7 @@ bpf_object__probe_caps(struct bpf_object *obj) for (i = 0; i < ARRAY_SIZE(probe_fn); i++) { ret = probe_fn[i](obj); if (ret < 0) - return ret; + pr_debug("Probe #%d failed with %d.\n", i, ret); } return 0; |