From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753776AbbIWIpP (ORCPT ); Wed, 23 Sep 2015 04:45:15 -0400 Received: from terminus.zytor.com ([198.137.202.10]:34876 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753742AbbIWIpJ (ORCPT ); Wed, 23 Sep 2015 04:45:09 -0400 Date: Wed, 23 Sep 2015 01:44:50 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: hpa@zytor.com, bp@suse.de, namhyung@kernel.org, adrian.hunter@intel.com, mingo@kernel.org, wangnan0@huawei.com, fweisbec@gmail.com, eranian@google.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, acme@redhat.com, dsahern@gmail.com, ast@plumgrid.com, jolsa@kernel.org Reply-To: jolsa@kernel.org, ast@plumgrid.com, dsahern@gmail.com, tglx@linutronix.de, acme@redhat.com, linux-kernel@vger.kernel.org, eranian@google.com, fweisbec@gmail.com, wangnan0@huawei.com, mingo@kernel.org, namhyung@kernel.org, adrian.hunter@intel.com, bp@suse.de, hpa@zytor.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] tools lib bpf: Use FEATURE_USER to allow building in the same dir as perf Git-Commit-ID: 65f041bee7838e2a91dbbc0a917d9291adbb3484 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 65f041bee7838e2a91dbbc0a917d9291adbb3484 Gitweb: http://git.kernel.org/tip/65f041bee7838e2a91dbbc0a917d9291adbb3484 Author: Arnaldo Carvalho de Melo AuthorDate: Mon, 21 Sep 2015 17:25:27 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 22 Sep 2015 10:47:05 -0300 tools lib bpf: Use FEATURE_USER to allow building in the same dir as perf When building tools/lib/bpf as part of the tools/perf/ build process, which will happend when we introduce a patch wiring that up, we end up stomping on the feature detection caching mechanism, that uses a file in the output directory (O=) that is shared by libbpf and perf to check if something changed from one build to another that requires redoing the feature detection process. By using the recently introduced FEATURE_USER tools/build/ knob, we can avoid that: Before, every make invokation would run the feature detection: $ make O=/tmp/build/perf -C tools/perf make: Entering directory '/home/git/linux/tools/perf' Auto-detecting system features: ... dwarf: [ on ] ... glibc: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ] GEN perf-archive GEN perf-with-kcore Auto-detecting system features: ... libelf: [ on ] ... bpf: [ on ] After: $ make O=/tmp/build/perf -C tools/perf make: Entering directory '/home/git/linux/tools/perf' BUILD: Doing 'make -j4' parallel build make: Leaving directory '/home/git/linux/tools/perf' $ Because we now have two different feature detection state files: $ ls -la /tmp/build/perf/FEATURE-DUMP* -rw-rw-r--. 1 acme acme 338 Sep 21 17:25 /tmp/build/perf/FEATURE-DUMP -rw-rw-r--. 1 acme acme 33 Sep 21 17:25 /tmp/build/perf/FEATURE-DUMP.libbpf $ Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexei Starovoitov Cc: Borislav Petkov Cc: David Ahern Cc: Frederic Weisbecker Cc: Namhyung Kim Cc: Stephane Eranian Cc: Wang Nan Cc: pi3orama@163.com Fixes: 1b76c13e4b36 ("bpf tools: Introduce 'bpf' library and add bpf feature check") Link: http://lkml.kernel.org/n/tip-s6ev9wfqy7pvvs58emys2g90@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/bpf/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index 604c120..e630f9f 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -64,6 +64,7 @@ srctree := $(patsubst %/,%,$(dir $(srctree))) #$(info Determined 'srctree' to be $(srctree)) endif +FEATURE_USER = .libbpf FEATURE_TESTS = libelf libelf-getphdrnum libelf-mmap bpf FEATURE_DISPLAY = libelf bpf