[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191126133806.GA19483@kernel.org>
Date: Tue, 26 Nov 2019 10:38:06 -0300
From: Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To: Jiri Olsa <jolsa@...nel.org>
Cc: lkml <linux-kernel@...r.kernel.org>, netdev@...r.kernel.org,
bpf@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Michael Petlan <mpetlan@...hat.com>,
Toke Høiland-Jørgensen <toke@...hat.com>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Daniel Borkmann <daniel@...earbox.net>,
Alexei Starovoitov <alexei.starovoitov@...il.com>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Andrii Nakryiko <andriin@...com>
Subject: Re: [PATCH] perf tools: Allow to link with libbpf dynamicaly
Em Tue, Nov 26, 2019 at 01:12:53PM +0100, Jiri Olsa escreveu:
> Currently we support only static linking with kernel's
> libbpf (tools/lib/bpf). This patch adds libbpf package
> detection and support to link perf with it dynamically.
>
> The libbpf package status is displayed with:
>
> $ make VF=1
> Auto-detecting system features:
> ...
> ... libbpf: [ on ]
>
> It's not checked by default, because it's quite new.
> Once it's on most distros we can switch it on.
>
> For the same reason it's not added to the test-all check.
>
> Perf does not need advanced version of libbpf, so we can
> check just for the base bpf_object__open function.
>
> Adding new compile variable to detect libbpf package and
> link bpf dynamically:
>
> $ make LIBBPF_DYNAMIC=1
> ...
> LINK perf
> $ ldd perf | grep bpf
> libbpf.so.0 => /lib64/libbpf.so.0 (0x00007f46818bc000)
>
> If libbpf is not installed, build stops with:
>
> Makefile.config:486: *** Error: No libbpf devel library found,\
> please install libbpf-devel. Stop.
Thanks, tested with how I build it:
$ make LIBBPF_DYNAMIC=1 -C tools/perf O=/tmp/build/perf
make: Entering directory '/home/acme/git/perf/tools/perf'
BUILD: Doing 'make -j8' parallel build
Makefile.config:493: *** Error: No libbpf devel library found, please install libbpf-devel. Stop.
make[1]: *** [Makefile.perf:225: sub-make] Error 2
make: *** [Makefile:70: all] Error 2
make: Leaving directory '/home/acme/git/perf/tools/perf'
$
works as well as advertised, applied.
- Arnaldo
Powered by blists - more mailing lists