From patchwork Thu Nov 21 14:52:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 21665 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C8CFA20E7C for ; Thu, 21 Nov 2013 14:52:38 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wo20sf2096740obc.5 for ; Thu, 21 Nov 2013 06:52:38 -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=HOPGNOZgmLnN9/7AJ6AOVJ1HE06kr/tguTK2qo1wF1M=; b=f4JggW3TeGmh6kGCZ2V3DyUYoAJeqRD0AIQnsxoOjyACq8OAek3/JMHs8jeemaYIBx M5eP11AhSjvPeGGRErHEeRfzyDQZSYcS/mRd4qfxeZTnEwimuZZxmnq5it8LfL2stLgY 745N6eJheyMCO3dXx8cFE7E9r072uSqfWMiSRcgdHi4GwypiHmR4yR+l2g+lOxFYn+IM VVwcES8NgdZYSmmp/m1PozJsFWXzE/Dnn4gDth9D2uLphPh83CkTZy+MkMzoUmEsAf2C MKDQDn7K1yokVcxOaZqvZ5fT0/5BDtcSkAMUFnvS6cF345jYXkedTkHQk5Rrh7MMTxvv +B9Q== X-Gm-Message-State: ALoCoQlsv8Fi+iBLWPfcLpHDQkm+/5niG1pNlRBzse5RVfN6+o1lKpUONRJqR5SC7Jz5s6zL7VFt X-Received: by 10.182.236.74 with SMTP id us10mr2280250obc.36.1385045558435; Thu, 21 Nov 2013 06:52:38 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.25.196 with SMTP id e4ls555066qeg.6.gmail; Thu, 21 Nov 2013 06:52:38 -0800 (PST) X-Received: by 10.221.44.136 with SMTP id ug8mr6238542vcb.13.1385045558297; Thu, 21 Nov 2013 06:52:38 -0800 (PST) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id o3si11046597ves.124.2013.11.21.06.52.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Nov 2013 06:52:38 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.173 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.173; Received: by mail-ve0-f173.google.com with SMTP id oz11so2687773veb.4 for ; Thu, 21 Nov 2013 06:52:38 -0800 (PST) X-Received: by 10.220.144.80 with SMTP id y16mr6272482vcu.4.1385045558202; Thu, 21 Nov 2013 06:52: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 u4csp2424vcz; Thu, 21 Nov 2013 06:52:37 -0800 (PST) X-Received: by 10.14.0.72 with SMTP id 48mr3198595eea.50.1385045557233; Thu, 21 Nov 2013 06:52:37 -0800 (PST) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx.google.com with ESMTPS id 2si13521807eer.236.2013.11.21.06.52.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Nov 2013 06:52:37 -0800 (PST) Received-SPF: neutral (google.com: 74.125.83.54 is neither permitted nor denied by best guess record for domain of jean.pihet@linaro.org) client-ip=74.125.83.54; Received: by mail-ee0-f54.google.com with SMTP id e51so4638993eek.27 for ; Thu, 21 Nov 2013 06:52:36 -0800 (PST) X-Received: by 10.14.210.8 with SMTP id t8mr4653775eeo.39.1385045556693; Thu, 21 Nov 2013 06:52:36 -0800 (PST) Received: from localhost.localdomain (226.91-241-81.adsl-dyn.isp.belgacom.be. [81.241.91.226]) by mx.google.com with ESMTPSA id 8sm70903795eem.15.2013.11.21.06.52.35 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 21 Nov 2013 06:52:36 -0800 (PST) From: Jean Pihet To: linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, Will Deacon , Jiri Olsa , Ingo Molnar , Arnaldo Cc: patches@linaro.org, Jean Pihet Subject: [PATCH 2/2] perf: unwinding: use the per-feature check flags Date: Thu, 21 Nov 2013 15:52:19 +0100 Message-Id: <1385045539-24537-3-git-send-email-jean.pihet@linaro.org> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1385045539-24537-1-git-send-email-jean.pihet@linaro.org> References: <1385045539-24537-1-git-send-email-jean.pihet@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: jean.pihet@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 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: , 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 --- 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 c551495..80ea6d8 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 87e7900..8dffb62 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