From patchwork Tue Dec 10 10:05:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 22204 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9E5A223908 for ; Tue, 10 Dec 2013 10:05:06 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id at1sf18106368iec.3 for ; Tue, 10 Dec 2013 02:05:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=525Qu0sw3ayNOKtsGjs+BrnH2hkqtv1McOFqJBPFEbc=; b=hRIdVqqnLqu0xRggWfQ0HvUHNigjbxoNwTeSzJMQcLFsc3P5zDgr2z9WOQK2bEA8x3 nv8i7N9IxwYU9PSlCXZeLdeSU5sqzjYRACmpL//UoVs0Qu+X5T2HgmbG3BuIvPdca0m+ lkymLbLBNqWtMkq/gMOWSGU0pAmFb4eNvWpO62AAuhj2DgqIqJQ+qBTrppKCeJmY7ecV pki6ld1TDVdsm9NZdWVrmq7TKWrPUvAG7COMss9bUCBPOn1h8lkar4OFVdN1heDDuLxo NQt+aBgUsB/kbphlcPR+1mmjYPbcXYx+vUcLKABJ/eLRffSY+OlpTEewLR6UAoAujw5m OtRg== X-Gm-Message-State: ALoCoQkpvO/pqDaR48jOx/HvaPbc4WNuM1WrWB8OJsp743cwV4rt2YJSl1nqS2O3byKe9C2ZgraA X-Received: by 10.42.84.136 with SMTP id m8mr33883000icl.9.1386669905632; Tue, 10 Dec 2013 02:05:05 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.106.70 with SMTP id gs6ls2422061qeb.17.gmail; Tue, 10 Dec 2013 02:05:05 -0800 (PST) X-Received: by 10.221.60.134 with SMTP id ws6mr347505vcb.44.1386669905538; Tue, 10 Dec 2013 02:05:05 -0800 (PST) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id fx15si4993042vec.34.2013.12.10.02.05.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 02:05:05 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id lc6so4340637vcb.41 for ; Tue, 10 Dec 2013 02:05:05 -0800 (PST) X-Received: by 10.52.166.47 with SMTP id zd15mr74120vdb.77.1386669905445; Tue, 10 Dec 2013 02:05:05 -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 u4csp175360vcz; Tue, 10 Dec 2013 02:05:05 -0800 (PST) X-Received: by 10.59.1.41 with SMTP id bd9mr71108ved.63.1386669905057; Tue, 10 Dec 2013 02:05:05 -0800 (PST) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by mx.google.com with ESMTPS id gw1si4986810vcb.62.2013.12.10.02.05.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 02:05:05 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of jean.pihet@linaro.org) client-ip=209.85.212.49; Received: by mail-vb0-f49.google.com with SMTP id x11so366702vbb.8 for ; Tue, 10 Dec 2013 02:05:04 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.53.13.44 with SMTP id ev12mr10838060vdd.17.1386669904888; Tue, 10 Dec 2013 02:05:04 -0800 (PST) Received: by 10.58.96.5 with HTTP; Tue, 10 Dec 2013 02:05:04 -0800 (PST) In-Reply-To: <20131210095723.GB2352@krava.brq.redhat.com> References: <1386411461-21510-1-git-send-email-jean.pihet@linaro.org> <1386411461-21510-3-git-send-email-jean.pihet@linaro.org> <20131209171719.GA16631@krava.brq.redhat.com> <20131210095723.GB2352@krava.brq.redhat.com> Date: Tue, 10 Dec 2013 11:05:04 +0100 Message-ID: Subject: Re: [PATCH 2/2] perf: unwinding: use the per-feature check flags From: Jean Pihet To: Jiri Olsa Cc: "linux-kernel@vger.kernel.org" , "linaro-kernel@lists.linaro.org" , Ingo Molnar , Arnaldo , Will Deacon , Patch Tracking 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.220.182 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: , Hi Jiri, On 10 December 2013 10:57, Jiri Olsa wrote: > On Mon, Dec 09, 2013 at 07:02:02PM +0100, Jean Pihet wrote: >> Hi Jiri, >> >> On 9 December 2013 18:17, Jiri Olsa wrote: >> > On Sat, Dec 07, 2013 at 11:17:41AM +0100, Jean Pihet wrote: >> >> 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 x86_64, ARMv7 and ARMv8 with and without LIBUNWIND_DIR set >> >> in 'make -C tools/perf' >> >> >> >> Signed-off-by: Jean Pihet >> >> Cc: Jiri Olsa >> > >> > SNIP >> > >> >> +BUILD = $(CC) $(CFLAGS) -o $(OUTPUT)$@ $@.c $(LDFLAGS) >> >> >> >> ############################### >> >> >> >> 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 >> > >> > hum, the test-all build command should have every possible flags we use, right? >> > including LIBUNWIND_CFLAGS, LIBUNWIND_LDFLAGS >> Oh yes you are right. I am overlooked the test-all feature (which >> never builds on my modest embedded systems). >> $(LIBUNWIND_LIBS) should be replaced by $(LIBUNWIND_CFLAGS) >> $(LIBUNWIND_LDFLAGS), is that a reasonable approach? > > hum, I'm just dealing with same issue for new libdw feature.. ;-) > > I was wondering we could just setup: > FEATURE_CHECK_CFLAGS-all > FEATURE_CHECK_LDFLAGS-all > > automatically from all defined FEATURE_CHECK_(C|LD)FLAGS-* > just a thought.. haven't tried it yet Yes that is the idea. The per-feature flags are designed for that purpose. For now I have the fix for libunwind only, cf. here below. All features should use the flags. There are complex cases though (e.g perl flags in config/Makefile andconfig/feature-checks)... My plan is to submit the ix for libunwind first and if ok care about the other features. Is that OK? > > jirka Thx, Jean diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index d24b4bd..65bc78e 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile @@ -56,10 +56,14 @@ else endif LIBUNWIND_LDFLAGS += $(LIBUNWIND_LIBS) + # Set per-feature check compilation flags 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) + # and the flags for the test-all case + FEATURE_CHECK_CFLAGS-all += $(LIBUNWIND_CFLAGS) + FEATURE_CHECK_LDFLAGS-all += $(LIBUNWIND_LDFLAGS) endif ifeq ($(NO_PERF_REGS),0)