Re: [PATCH 0/3] perf/bpftool: Allow to link libbpf dynamically

From: Toke HÃiland-JÃrgensen
Date: Mon Dec 02 2019 - 13:09:04 EST


Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> writes:

> On Wed, Nov 27, 2019 at 1:49 AM Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
>>
>> hi,
>> adding support to link bpftool with libbpf dynamically,
>> and config change for perf.
>>
>> It's now possible to use:
>> $ make -C tools/bpf/bpftool/ LIBBPF_DYNAMIC=1
>
> I wonder what's the motivation behind these changes, though? Why is
> linking bpftool dynamically with libbpf is necessary and important?
> They are both developed tightly within kernel repo, so I fail to see
> what are the huge advantages one can get from linking them
> dynamically.

Well, all the regular reasons for using dynamic linking (memory usage,
binary size, etc). But in particular, the ability to update the libbpf
package if there's a serious bug, and have that be picked up by all
utilities making use of it. No reason why bpftool should be special in
that respect.

-Toke