Skip to content

Commit

Permalink
libbpf: Skip bpf_object__probe_loading for light skeleton
Browse files Browse the repository at this point in the history
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: 6723474 ("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]
  • Loading branch information
fomichev authored and anakryiko committed May 24, 2021
1 parent ec7d6dd commit f9bceaa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/lib/bpf/libbpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit f9bceaa

Please sign in to comment.