diff options
| author | Stanislav Fomichev <[email protected]> | 2021-05-21 03:06:53 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2021-05-24 19:22:09 +0000 |
| commit | f9bceaa59c5c47a8a08f48e19cbe887e500a1978 (patch) | |
| tree | 3bb06244789135bb4f40556ea6af1cae66a3f798 /tools/lib/bpf/libbpf.c | |
| parent | ethernet: ucc_geth: Use kmemdup() rather than kmalloc+memcpy (diff) | |
| download | kernel-f9bceaa59c5c47a8a08f48e19cbe887e500a1978.tar.gz kernel-f9bceaa59c5c47a8a08f48e19cbe887e500a1978.zip | |
libbpf: Skip bpf_object__probe_loading for light skeleton
I'm getting the following error when running 'gen skeleton -L' as
regular user:
libbpf: Error in bpf_object__probe_loading():Operation not permitted(1).
Couldn't load trivial BPF program. Make sure your kernel supports BPF
(CONFIG_BPF_SYSCALL=y) and/or that RLIMIT_MEMLOCK is set to big enough
value.
Fixes: 67234743736a ("libbpf: Generate loader program out of BPF ELF file.")
Signed-off-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
| -rw-r--r-- | tools/lib/bpf/libbpf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index dc4d5fe6d9d2..b396e45b17ea 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -3971,6 +3971,9 @@ bpf_object__probe_loading(struct bpf_object *obj) }; int ret; + if (obj->gen_loader) + return 0; + /* make sure basic loading works */ memset(&attr, 0, sizeof(attr)); |
