Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752787AbbF3CaY (ORCPT ); Mon, 29 Jun 2015 22:30:24 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:57514 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752884AbbF3CaS (ORCPT ); Mon, 29 Jun 2015 22:30:18 -0400 Message-ID: <5591FEF4.9030401@huawei.com> Date: Tue, 30 Jun 2015 10:29:08 +0800 From: "Wangnan (F)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo CC: , , , , , , , , , , , , , , Subject: Re: [RFC PATCH v9 02/50] tools build: Add feature check for eBPF API References: <1435328155-87115-1-git-send-email-wangnan0@huawei.com> <1435328155-87115-3-git-send-email-wangnan0@huawei.com> <20150629192151.GC1225@kernel.org> <20150629194118.GD1225@kernel.org> In-Reply-To: <20150629194118.GD1225@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.5591FF0F.0005,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: d6aeec4e5356805a78cc8fb5d2601c7c Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5280 Lines: 142 On 2015/6/30 3:41, Arnaldo Carvalho de Melo wrote: > Em Mon, Jun 29, 2015 at 04:21:51PM -0300, Arnaldo Carvalho de Melo escreveu: >> Em Fri, Jun 26, 2015 at 02:15:07PM +0000, Wang Nan escreveu: >>> In this patch, eBPF API is checked by compiling a c source file which >>> uses fields in bpf_attr which will be used by libbpf. >>> >>> Signed-off-by: Wang Nan >>> Acked-by: Alexei Starovoitov >> So, I just applied this and after trying: >> >> [acme@felicio linux]$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf >> ; make O=/tmp/build/perf -C tools/perf install-bin >> 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: [ OFF ] >> >> MKDIR /tmp/build/perf/util/ >> CC /tmp/build/perf/util/abspath.o >> >> -------------------------------------------------------- >> >> So, what should I do now? I want to have that OFF line turned to "on", >> so that I can test this stuff. >> >> But the changelog says nothing about it, lemme check the cover letter, >> but having to do that is annoying, one expects to have instructions >> related to some specific changeset in its comments... > So, when such build tests fail, we can see why by looking for a file > with a special name in the O= output dir: > > [acme@felicio linux]$ cat /tmp/build/perf/feature/test-bpf.make.output > test-bpf.c:1:23: fatal error: linux/bpf.h: No such file or directory > #include > ^ > compilation terminated. > [acme@felicio linux]$ This patch tries to check the version of bpf.h, because old bpf.h doesn't define 'kern_version' field for 'union bpf_attr'. I think the problem you meet is caused by missing of kernel headers in your host system environment. After patch 'perf tools: Make perf depend on libbpf' this checking should always success because it adds required headers into MANIFEST and setup FEATURE_CHECK_CFLAGS-bpf. Also, after applying 3/50 you should see this: # make O=/tmp/build/bpf/ -C tools/lib/bpf/ Auto-detecting system features: ... libelf: [ on ] ... libelf-getphdrnum: [ on ] ... libelf-mmap: [ on ] ... bpf: [ on ] make: Entering directory `/home/wn/kernel-hydrogen/tools/lib/bpf' CC /tmp/build/bpf/libbpf.o LD /tmp/build/bpf/libbpf-in.o LINK /tmp/build/bpf/libbpf.a LINK /tmp/build/bpf/libbpf.so make: Leaving directory `/home/wn/kernel/tools/lib/bpf' Even if in perf checking bpf should fail in your machine now, checking bpf feature in libbpf should success because when build libbpf I have added following setting to tools/lib/bpf/Makefile: INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/arch/$(ARCH)/include/uapi -I$(srctree)/include/uapi FEATURE_CHECK_CFLAGS-bpf = $(INCLUDES) Do you want me to squash 2/30 and 3/50 together and append 'bpf' checker into FEATURE_TESTS in tools/build/Makefile.feature in 23/50? Then there should be less confusion: when compiling perf before 23/50, bpf feature will never be checked then. Thank you. > Right, one of the few things that could explain the failure, but: > > [acme@felicio linux]$ find . -name bpf.h > ./include/linux/bpf.h > ./include/uapi/linux/bpf.h > [acme@felicio linux]$ > > So lemme try doing it in place: > > [acme@felicio linux]$ make -C tools/perf/ > 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: [ OFF ] > > > Doesn't work as well :-\ > > Looking at the following patches... > > - Arnaldo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/