Re: [RFC PATCH v10 23/50] perf tools: Make perf depend on libbpf
From: Arnaldo Carvalho de Melo
Date: Tue Jul 07 2015 - 15:55:34 EST
Em Wed, Jul 01, 2015 at 02:14:11AM +0000, Wang Nan escreveu:
> By adding libbpf into perf's Makefile, this patch enables perf to
> build libbpf during building if libelf is found and neither NO_LIBELF
> nor NO_LIBBPF is set. The newly introduced code is similar to libapi
> and libtraceevent building in Makefile.perf.
>
> MANIFEST is also updated for 'make perf-*-src-pkg'.
>
> Append make_no_libbpf to tools/perf/tests/make.
>
> 'bpf' feature check is appended into default FEATURE_TESTS and
> FEATURE_DISPLAY, so perf will check API version of bpf in
> /path/to/kernel/include/uapi/linux/bpf.h. Which should not fail
> except when we are trying to port this code to an old kernel.
>
> Error messages are also updated to notify users about the disable of
> BPF support of 'perf record' if libelf is missed or BPF API check
> failed.
Much better!
[acme@felicio linux]$ am /wb/1.patch
Applying: perf tools: Make perf depend on libbpf
[perf/ebpf 53ec442e0d44] perf tools: Make perf depend on libbpf
Author: Wang Nan <wangnan0@xxxxxxxxxx>
5 files changed, 45 insertions(+), 6 deletions(-)
[acme@felicio linux]$ m
make: Entering directory `/home/acme/git/linux/tools/perf'
BUILD: Doing 'make -j4' parallel build
Auto-detecting system features:
... dwarf: [ on ]
... glibc: [ on ]
... gtk2: [ on ]
... libaudit: [ on ]
... libbfd: [ on ]
... libelf: [ on ]
... libnuma: [ on ]
... libperl: [ on ]
... libpython: [ on ]
... libslang: [ on ]
... libunwind: [ on ]
... libdw-dwarf-unwind: [ on ]
... zlib: [ on ]
... lzma: [ on ]
... bpf: [ on ]
CC /tmp/build/perf/arch/common.o
CC /tmp/build/perf/util/abspath.o
CC /tmp/build/perf/builtin-bench.o
Auto-detecting system features:
... libelf: [ on ]
... libelf-getphdrnum: [ on ]
... libelf-mmap: [ on ]
... bpf: [ on ]
CC /tmp/build/perf/libbpf.o
<SNIP>
Just a few nits, perhaps we should add what is the subsystem that is
asking for feature detection, so those two lines starting with
'Auto-detecting' would become:
Auto-detecting system features for tools/perf/:
<SNIP>
Auto-detecting system features for tools/lib/bpf/:
<SNIP>
------------------------------------
Also we need to reuse the tests, i.e. we're testing 'libelf'
twice, once for tools/perf, then for tools/lib/bpf, Jiri?
------------------------------------
Anyway, continuing...
- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/