From patchwork Wed Nov 27 20:16:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 21820 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2A0D523FE8 for ; Wed, 27 Nov 2013 20:25:39 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id e14sf24748463iej.8 for ; Wed, 27 Nov 2013 12:25:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=NHkyEvyn3g5C5w/gPssctv/ItMookLIPXFQG75/OIms=; b=hsb7BHiYnvFbkHorlMmTJZRcTN50iK78L8xLL9t7R1L5GZxlNIZ8hBZwAtTiD7FPHC bCjsPcZMmEPqZN7CsQgRKFOBUQ++3y6loa/it2w5hJyQU33MooTuBJ2RDobTITXZh1/n 63YRVfmWyHl04wpW7x97gZAmvMKLKY3pVuj5j3Y7e6W38GBkn9avOHvPntfssK6FIT4F b9uWepJM7K0qhWl4MhEb8k2v9jKTbecgAPVvDj9uL3udckVw4rwYgL+gVkbErR5vqwc1 Xj45o9zJFjZX7/h9P1MRBRGBzW6Qyi2qnO77+Ocic1X0QNp6Si3aZrX/phimht2XOmSs 0V8w== X-Gm-Message-State: ALoCoQmGIHkij0ukqHQBvlqS8Um9c6avzCQ1iDaoPqg7oU90a+MFT9I9PX4YcOCmhPc4VdTQt8gB X-Received: by 10.182.22.73 with SMTP id b9mr13164022obf.17.1385583938950; Wed, 27 Nov 2013 12:25:38 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.120.5 with SMTP id ky5ls3281330qeb.26.gmail; Wed, 27 Nov 2013 12:25:38 -0800 (PST) X-Received: by 10.52.165.131 with SMTP id yy3mr10187284vdb.25.1385583938869; Wed, 27 Nov 2013 12:25:38 -0800 (PST) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id dp7si21587133ved.111.2013.11.27.12.25.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Nov 2013 12:25:38 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id c14so5410175vea.23 for ; Wed, 27 Nov 2013 12:25:38 -0800 (PST) X-Received: by 10.52.231.130 with SMTP id tg2mr103504vdc.16.1385583938595; Wed, 27 Nov 2013 12:25:38 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp14962vcz; Wed, 27 Nov 2013 12:25:38 -0800 (PST) X-Received: by 10.224.7.10 with SMTP id b10mr70784480qab.12.1385583938043; Wed, 27 Nov 2013 12:25:38 -0800 (PST) Received: from merlin.infradead.org (merlin.infradead.org. [2001:4978:20e::2]) by mx.google.com with ESMTPS id q2si247617qas.133.2013.11.27.12.25.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Nov 2013 12:25:38 -0800 (PST) Received-SPF: pass (google.com: domain of BATV+acb7cea38bfd76e1353d+3748+infradead.org+acme@merlin.srs.infradead.org designates 2001:4978:20e::2 as permitted sender) client-ip=2001:4978:20e::2; Received: from [177.158.179.50] (helo=zoo.ghostprotocols.net) by merlin.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vllfw-0001C2-Q7; Wed, 27 Nov 2013 20:25:32 +0000 Received: by zoo.ghostprotocols.net (Postfix, from userid 1000) id B85701E1B76; Wed, 27 Nov 2013 17:16:39 -0300 (BRT) From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Jean Pihet , Arnaldo Carvalho de Melo , Jiri Olsa , Will Deacon , linaro-kernel@lists.linaro.org, patches@linaro.org, Arnaldo Carvalho de Melo Subject: [PATCH 34/34] perf tools unwinding: Use the per-feature check flags Date: Wed, 27 Nov 2013 17:16:34 -0300 Message-Id: <1385583394-3703-35-git-send-email-acme@infradead.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1385583394-3703-1-git-send-email-acme@infradead.org> References: <1385583394-3703-1-git-send-email-acme@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by merlin.infradead.org See http://www.infradead.org/rpr.html X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: acme@infradead.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Jean Pihet Use the per-feature check flags for the unwinding feature in order to correctly compile the libunwind and libunwind-debug-frame feature checks. Tested on ARMv7 and ARMv8 with 'make DEBUG=1 LIBUNWIND_DIR=/usr/local -C tools/perf' Signed-off-by: Jean Pihet Acked-by: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Ingo Molnar Cc: Jiri Olsa Cc: Will Deacon Cc: linaro-kernel@lists.linaro.org Cc: patches@linaro.org Link: http://lkml.kernel.org/r/1385045539-24537-3-git-send-email-jean.pihet@linaro.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/config/Makefile | 38 +++++++++++++++++-------------- tools/perf/config/feature-checks/Makefile | 6 ++--- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index c55149538d92..80ea6d823908 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile @@ -36,6 +36,26 @@ ifeq ($(ARCH),arm) LIBUNWIND_LIBS = -lunwind -lunwind-arm endif +ifeq ($(LIBUNWIND_LIBS),) + NO_LIBUNWIND := 1 +else + # + # For linking with debug library, run like: + # + # make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/ + # + ifdef LIBUNWIND_DIR + LIBUNWIND_CFLAGS = -I$(LIBUNWIND_DIR)/include + LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib + endif + LIBUNWIND_LDFLAGS += $(LIBUNWIND_LIBS) + + FEATURE_CHECK_CFLAGS-libunwind = $(LIBUNWIND_CFLAGS) + FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS) + FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS) + FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS) +endif + ifeq ($(NO_PERF_REGS),0) CFLAGS += -DHAVE_PERF_REGS_SUPPORT endif @@ -102,7 +122,7 @@ endif feature_check = $(eval $(feature_check_code)) define feature_check_code - feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" LIBUNWIND_LIBS="$(LIBUNWIND_LIBS)" -C config/feature-checks test-$1 >/dev/null 2>/dev/null && echo 1 || echo 0) + feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C config/feature-checks test-$1 >/dev/null 2>/dev/null && echo 1 || echo 0) endef feature_set = $(eval $(feature_set_code)) @@ -310,21 +330,7 @@ ifndef NO_LIBELF endif # NO_DWARF endif # NO_LIBELF -ifeq ($(LIBUNWIND_LIBS),) - NO_LIBUNWIND := 1 -endif - ifndef NO_LIBUNWIND - # - # For linking with debug library, run like: - # - # make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/ - # - ifdef LIBUNWIND_DIR - LIBUNWIND_CFLAGS := -I$(LIBUNWIND_DIR)/include - LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib - endif - ifneq ($(feature-libunwind), 1) msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1); NO_LIBUNWIND := 1 @@ -340,9 +346,7 @@ ifndef NO_LIBUNWIND CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME endif endif -endif -ifndef NO_LIBUNWIND CFLAGS += -DHAVE_LIBUNWIND_SUPPORT EXTLIBS += $(LIBUNWIND_LIBS) CFLAGS += $(LIBUNWIND_CFLAGS) diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile index 87e790017c69..8dffb628dac8 100644 --- a/tools/perf/config/feature-checks/Makefile +++ b/tools/perf/config/feature-checks/Makefile @@ -38,7 +38,7 @@ BUILD = $(CC) $(CFLAGS) $(LDFLAGS) -o $(OUTPUT)$@ $@.c ############################### test-all: - $(BUILD) -Werror -fstack-protector -fstack-protector-all -O2 -Werror -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma $(LIBUNWIND_LIBS) -lelf -laudit -I/usr/include/slang -lslang $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl + $(BUILD) -Werror -fstack-protector -fstack-protector-all -O2 -Werror -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl test-hello: $(BUILD) @@ -74,10 +74,10 @@ test-libnuma: $(BUILD) -lnuma test-libunwind: - $(BUILD) $(LIBUNWIND_LIBS) -lelf + $(BUILD) -lelf test-libunwind-debug-frame: - $(BUILD) $(LIBUNWIND_LIBS) -lelf + $(BUILD) -lelf test-libaudit: $(BUILD) -laudit