From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753261AbbCJOMR (ORCPT ); Tue, 10 Mar 2015 10:12:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37221 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751729AbbCJOMM (ORCPT ); Tue, 10 Mar 2015 10:12:12 -0400 Date: Tue, 10 Mar 2015 15:11:11 +0100 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , linux-kernel@vger.kernel.org, Sebastian Andrzej Siewior , David Ahern , Frederic Weisbecker , Jeremie Galarneau , Namhyung Kim , Paul Mackerras , Peter Zijlstra , Tom Zanussi , Wang Nan Subject: Re: [PATCH] perf build: Fix libbabeltrace detection Message-ID: <20150310141111.GB4333@krava.redhat.com> References: <1424470628-5969-6-git-send-email-jolsa@kernel.org> <20150225192344.GH18705@kernel.org> <20150301132043.GA17097@krava.redhat.com> <20150302153220.GD6723@redhat.com> <20150309121203.GF27885@krava.brq.redhat.com> <20150309215121.GB14515@redhat.com> <20150309231119.GD14515@redhat.com> <20150309232845.GE14515@redhat.com> <20150310120035.GA4333@krava.redhat.com> <20150310140134.GF14515@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150310140134.GF14515@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 10, 2015 at 11:01:34AM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Mar 10, 2015 at 01:00:35PM +0100, Jiri Olsa escreveu: > > On Mon, Mar 09, 2015 at 08:28:45PM -0300, Arnaldo Carvalho de Melo wrote: > > > Em Mon, Mar 09, 2015 at 08:11:19PM -0300, Arnaldo Carvalho de Melo escreveu: > > > > Em Mon, Mar 09, 2015 at 06:51:21PM -0300, Arnaldo Carvalho de Melo escreveu: > > > [root@zoo ~]# find /opt/libbabeltrace/include/babeltrace/ -type f | xargs grep bt_ctf_stream_class_get_packet_context_type > > > /opt/libbabeltrace/include/babeltrace/ctf-ir/stream-class.h:extern struct bt_ctf_field_type *bt_ctf_stream_class_get_packet_context_type( > > > > That seems to be included from the file included in the feature test code :-\ > > > Really ran out of time now... > > > ouch, thanks a lot for debugging.. the reason is indeed the -Werror added by: > > b49f1a4be701 perf tools: Improve feature test debuggability > > > following patch seems to fix this for me > > --- > > Following patch added -Werror for feature builds: > > b49f1a4be701 perf tools: Improve feature test debuggability > > > and broke libbabeltrace feature build, because it was including > > wrong header and gcc couldn't find the used symbol definition. > > > Adding proper header and keeping the old one as it is needed > > also (libbabeltrace quirk). > > > +++ b/tools/perf/config/feature-checks/test-libbabeltrace.c > > #include > > +#include > > Right, that was the fix I found as well, well, I was trying to include > _just_ babeltrace/ctf-ir/stream-class.h, but that is buggy in that it > doesn't include the header file with the uint32_t and int64_t types: yep, thats the 'libbabeltrace quirk' I mentioned in the changelog ;-) > > [acme@zoo linux]$ cat /tmp/build/perf/config/feature-checks/make-libbabeltrace > make[1]: Entering directory `/home/git/linux/tools/perf/config/feature-checks' > gcc -MD -I/opt/libbabeltrace//include -Wall -Werror -o /tmp/build/perf/config/feature-checks/test-libbabeltrace.bin test-libbabeltrace.c -Wl,-z,noexecstack -L/opt/libbabeltrace//lib -lbabeltrace-ctf # -lbabeltrace provided by > In file included from test-libbabeltrace.c:2:0: > /opt/libbabeltrace//include/babeltrace/ctf-ir/stream-class.h:118:1: error: unknown type name ‘int64_t’ > extern int64_t bt_ctf_stream_class_get_id( > ^ > /opt/libbabeltrace//include/babeltrace/ctf-ir/stream-class.h:134:45: error: unknown type name ‘uint32_t’ > struct bt_ctf_stream_class *stream_class, uint32_t id); > ^ > make[1]: *** [test-libbabeltrace.bin] Error 1 > make[1]: Leaving directory `/home/git/linux/tools/perf/config/feature-checks' > [acme@zoo linux]$ > > > > > int main(void) > > { > > -- > > 1.9.3 > > Ah, I found the following patch useful in debugging this, if you're ok with it, > I'll put it in my tree with your Acked-by, ok? > > - Arnaldo > > [acme@zoo linux]$ git diff tools/perf/config/Makefile > diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile > index e2350ada6ccd..4992c39652e6 100644 > --- a/tools/perf/config/Makefile > +++ b/tools/perf/config/Makefile > @@ -184,7 +184,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))" -C config/feature-checks test-$1.bin >/dev/null 2>/dev/null && echo 1 || > + 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.bin > $(OUTPUT_FEATURES)make-$(1) 2>&1 > endef ack, that seem usefull.. I always redirected this to '>> /tmp/krava' never got enough will to make it nice and generic ;-) thanks, jirka