diff mbox

[2/2] perf: unwinding: use the per-feature check flags

Message ID CAFrcx1kKmTf=6DjAbn8F=--KaijotSqo8_dkRFpgo5J+q8Vfeg@mail.gmail.com
State Superseded
Headers show

Commit Message

Jean Pihet Dec. 10, 2013, 10:05 a.m. UTC
Hi Jiri,

On 10 December 2013 10:57, Jiri Olsa <jolsa@redhat.com> wrote:
> On Mon, Dec 09, 2013 at 07:02:02PM +0100, Jean Pihet wrote:
>> Hi Jiri,
>>
>> On 9 December 2013 18:17, Jiri Olsa <jolsa@redhat.com> 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 <jean.pihet@linaro.org>
>> >> Cc: Jiri Olsa <jolsa@redhat.com>
>> >
>> > 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

Comments

Jiri Olsa Dec. 10, 2013, 10:13 a.m. UTC | #1
On Tue, Dec 10, 2013 at 11:05:04AM +0100, Jean Pihet wrote:
> Hi Jiri,
> 
> On 10 December 2013 10:57, Jiri Olsa <jolsa@redhat.com> wrote:
> > On Mon, Dec 09, 2013 at 07:02:02PM +0100, Jean Pihet wrote:
> >> Hi Jiri,
> >>
> >> On 9 December 2013 18:17, Jiri Olsa <jolsa@redhat.com> 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 <jean.pihet@linaro.org>
> >> >> Cc: Jiri Olsa <jolsa@redhat.com>
> >> >
> >> > 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?

sounds good, thanks

jirka
diff mbox

Patch

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)