mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-06 16:49:07 +08:00
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 <sdf@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210521030653.2626513-1-sdf@google.com
This commit is contained in:
committed by
Andrii Nakryiko
parent
546199a723
commit
b79c698300
@@ -3974,6 +3974,9 @@ bpf_object__probe_loading(struct bpf_object *obj)
|
|||||||
};
|
};
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (obj->gen_loader)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* make sure basic loading works */
|
/* make sure basic loading works */
|
||||||
|
|
||||||
memset(&attr, 0, sizeof(attr));
|
memset(&attr, 0, sizeof(attr));
|
||||||
|
|||||||
Reference in New Issue
Block a user