shared/bpf: install log callback and suppress most messages from libbpf
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 1 Jun 2022 22:27:52 +0000 (00:27 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 2 Jun 2022 08:48:31 +0000 (10:48 +0200)
commit44005a5778ca66848bf7e8dfe4c51ae62919bd69
tree37f879babeeefe06f564b934b1798be72b7fb665
parent386b8026e53fee454dee5d0215abfc57b51d5757
shared/bpf: install log callback and suppress most messages from libbpf

$ build/test-socket-bind
...
libbpf: load bpf program failed: Operation not permitted
libbpf: failed to load program 'sd_bind4'
libbpf: failed to load object 'socket_bind_bpf'
libbpf: failed to load BPF skeleton 'socket_bind_bpf': -1
Failed to load BPF object: Operation not permitted

Now all lines with "libbpf:" are at debug level and will be hidden by
default.

Partially fixes https://bugzilla.redhat.com/show_bug.cgi?id=2084955#c14
(i.e. the error that was exposed when the initial error was fixed.)
src/shared/bpf-dlopen.c
src/shared/bpf-dlopen.h