diff mbox

[34/34] perf tools unwinding: Use the per-feature check flags

Message ID 20131128095801.GA1245@krava.brq.redhat.com
State New
Headers show

Commit Message

Jiri Olsa Nov. 28, 2013, 9:58 a.m. UTC
On Wed, Nov 27, 2013 at 11:43:23PM +0100, Jiri Olsa wrote:
> On Wed, Nov 27, 2013 at 05:16:34PM -0300, Arnaldo Carvalho de Melo wrote:
> > From: Jean Pihet <jean.pihet@linaro.org>
> > 
> > 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'
> 
> this one makes my build fail:
> 
> [jolsa@krava perf]$ make
>   BUILD:   Doing 'make -j4' parallel build
> 
> Auto-detecting system features:
> ...                     backtrace: [ on  ]
> ...                         dwarf: [ on  ]
> ...                fortify-source: [ on  ]
> ...                         glibc: [ on  ]
> ...                          gtk2: [ on  ]
> ...                  gtk2-infobar: [ on  ]
> ...                      libaudit: [ on  ]
> ...                        libbfd: [ on  ]
> ...                        libelf: [ on  ]
> ...             libelf-getphdrnum: [ on  ]
> ...                   libelf-mmap: [ on  ]
> ...                       libnuma: [ on  ]
> ...                       libperl: [ on  ]
> ...                     libpython: [ on  ]
> ...             libpython-version: [ on  ]
> ...                      libslang: [ on  ]
> ...                     libunwind: [ OFF ]
> ...                       on-exit: [ on  ]
> ...                stackprotector: [ on  ]
> ...            stackprotector-all: [ on  ]
> ...                       timerfd: [ on  ]
> 
> config/Makefile:335: No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1
> 
> ...
> 
>   LINK     perf
> /bin/ld: cannot find -lunwind
> /bin/ld: cannot find -lunwind-x86_64
> collect2: error: ld returned 1 exit status
> make[1]: *** [perf] Error 1
> make[1]: *** Waiting for unfinished jobs....
> make: *** [all] Error 2
> 
> 
> I haven't checked this one.. will do tomorrow


we need to plug libunwind flags/libs only if
the $(feature-libunwind) is enabled..

NO_LIBUNWIND - user's decision not to link with libunwind or
               architecture that does not support it

$(feature-libunwind) - if it's actually installed

attached change fixies that for me, feel free to use/merge it

jirka

---

Comments

Arnaldo Carvalho de Melo Nov. 28, 2013, 12:56 p.m. UTC | #1
Em Thu, Nov 28, 2013 at 10:58:01AM +0100, Jiri Olsa escreveu:
> On Wed, Nov 27, 2013 at 11:43:23PM +0100, Jiri Olsa wrote:
> > On Wed, Nov 27, 2013 at 05:16:34PM -0300, Arnaldo Carvalho de Melo wrote:
> >   LINK     perf
> > /bin/ld: cannot find -lunwind
> > /bin/ld: cannot find -lunwind-x86_64
> > collect2: error: ld returned 1 exit status
> > make[1]: *** [perf] Error 1
> > make[1]: *** Waiting for unfinished jobs....
> > make: *** [all] Error 2

> > I haven't checked this one.. will do tomorrow
 
> we need to plug libunwind flags/libs only if
> the $(feature-libunwind) is enabled..
 
> NO_LIBUNWIND - user's decision not to link with libunwind or
>                architecture that does not support it
 
> $(feature-libunwind) - if it's actually installed
 
> attached change fixies that for me, feel free to use/merge it

Argh, I used tests/make on one machine where those two patches by Jean
were not applied, then rebased on another, the one I use to submit,
those got included but not tests/make tested, which probably explains
why this got thru :-\

Jean, can you please check that this works for you on ARM too?

- Arnaldo
Arnaldo Carvalho de Melo Nov. 28, 2013, 1:46 p.m. UTC | #2
Em Thu, Nov 28, 2013 at 09:56:19AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Thu, Nov 28, 2013 at 10:58:01AM +0100, Jiri Olsa escreveu:
> > On Wed, Nov 27, 2013 at 11:43:23PM +0100, Jiri Olsa wrote:
> > > On Wed, Nov 27, 2013 at 05:16:34PM -0300, Arnaldo Carvalho de Melo wrote:
> > >   LINK     perf
> > > /bin/ld: cannot find -lunwind
> > > /bin/ld: cannot find -lunwind-x86_64
> > > collect2: error: ld returned 1 exit status
> > > make[1]: *** [perf] Error 1
> > > make[1]: *** Waiting for unfinished jobs....
> > > make: *** [all] Error 2
> 
> > > I haven't checked this one.. will do tomorrow
>  
> > we need to plug libunwind flags/libs only if
> > the $(feature-libunwind) is enabled..
>  
> > NO_LIBUNWIND - user's decision not to link with libunwind or
> >                architecture that does not support it
>  
> > $(feature-libunwind) - if it's actually installed
>  
> > attached change fixies that for me, feel free to use/merge it
> 
> Argh, I used tests/make on one machine where those two patches by Jean
> were not applied, then rebased on another, the one I use to submit,
> those got included but not tests/make tested, which probably explains
> why this got thru :-\
> 
> Jean, can you please check that this works for you on ARM too?

I just noticed that this patch breaks the feature detection mechanism,
after it is applied it is back performing all tests at every make call,
this needs rethinking, so I'm dropping both.

Ingo, please disregard, yet again, my latest pull request, sigh.

Jiri, this could be something for tests/make, till then I'll try
to check this manually.

- Arnaldo
Jean Pihet Nov. 28, 2013, 8:02 p.m. UTC | #3
On 28 November 2013 14:46, Arnaldo Carvalho de Melo <acme@infradead.org> wrote:
> Em Thu, Nov 28, 2013 at 09:56:19AM -0300, Arnaldo Carvalho de Melo escreveu:
>> Em Thu, Nov 28, 2013 at 10:58:01AM +0100, Jiri Olsa escreveu:
>> > On Wed, Nov 27, 2013 at 11:43:23PM +0100, Jiri Olsa wrote:
>> > > On Wed, Nov 27, 2013 at 05:16:34PM -0300, Arnaldo Carvalho de Melo wrote:
>> > >   LINK     perf
>> > > /bin/ld: cannot find -lunwind
>> > > /bin/ld: cannot find -lunwind-x86_64
>> > > collect2: error: ld returned 1 exit status
>> > > make[1]: *** [perf] Error 1
>> > > make[1]: *** Waiting for unfinished jobs....
>> > > make: *** [all] Error 2
>>
>> > > I haven't checked this one.. will do tomorrow
>>
>> > we need to plug libunwind flags/libs only if
>> > the $(feature-libunwind) is enabled..
>>
>> > NO_LIBUNWIND - user's decision not to link with libunwind or
>> >                architecture that does not support it
>>
>> > $(feature-libunwind) - if it's actually installed
>>
>> > attached change fixies that for me, feel free to use/merge it
>>
>> Argh, I used tests/make on one machine where those two patches by Jean
>> were not applied, then rebased on another, the one I use to submit,
>> those got included but not tests/make tested, which probably explains
>> why this got thru :-\
>>
>> Jean, can you please check that this works for you on ARM too?
>
> I just noticed that this patch breaks the feature detection mechanism,
> after it is applied it is back performing all tests at every make call,
> this needs rethinking, so I'm dropping both.
Oh I am sorry about that. I tested on ARM with and without the
LIBUNWIND_DIR option set.
Let me rethink/rework this and come back to you with a proper fix.

>
> Ingo, please disregard, yet again, my latest pull request, sigh.
>
> Jiri, this could be something for tests/make, till then I'll try
> to check this manually.

One question though: are you OK with the principle of having
per-feature check flags? This brings two things to the feature
detection and build:
1. the ability to specify specific flags for the feature check, which
is not possible on the current code,
2. a simplification in the Makefiles.

Jean

>
> - Arnaldo
Jiri Olsa Nov. 29, 2013, 3:45 p.m. UTC | #4
On Thu, Nov 28, 2013 at 09:02:23PM +0100, Jean Pihet wrote:
> On 28 November 2013 14:46, Arnaldo Carvalho de Melo <acme@infradead.org> wrote:
> > Em Thu, Nov 28, 2013 at 09:56:19AM -0300, Arnaldo Carvalho de Melo escreveu:
> >> Em Thu, Nov 28, 2013 at 10:58:01AM +0100, Jiri Olsa escreveu:
> >> > On Wed, Nov 27, 2013 at 11:43:23PM +0100, Jiri Olsa wrote:
> >> > > On Wed, Nov 27, 2013 at 05:16:34PM -0300, Arnaldo Carvalho de Melo wrote:
> >> > >   LINK     perf
> >> > > /bin/ld: cannot find -lunwind
> >> > > /bin/ld: cannot find -lunwind-x86_64
> >> > > collect2: error: ld returned 1 exit status
> >> > > make[1]: *** [perf] Error 1
> >> > > make[1]: *** Waiting for unfinished jobs....
> >> > > make: *** [all] Error 2
> >>
> >> > > I haven't checked this one.. will do tomorrow
> >>
> >> > we need to plug libunwind flags/libs only if
> >> > the $(feature-libunwind) is enabled..
> >>
> >> > NO_LIBUNWIND - user's decision not to link with libunwind or
> >> >                architecture that does not support it
> >>
> >> > $(feature-libunwind) - if it's actually installed
> >>
> >> > attached change fixies that for me, feel free to use/merge it
> >>
> >> Argh, I used tests/make on one machine where those two patches by Jean
> >> were not applied, then rebased on another, the one I use to submit,
> >> those got included but not tests/make tested, which probably explains
> >> why this got thru :-\
> >>
> >> Jean, can you please check that this works for you on ARM too?
> >
> > I just noticed that this patch breaks the feature detection mechanism,
> > after it is applied it is back performing all tests at every make call,
> > this needs rethinking, so I'm dropping both.
> Oh I am sorry about that. I tested on ARM with and without the
> LIBUNWIND_DIR option set.
> Let me rethink/rework this and come back to you with a proper fix.
> 
> >
> > Ingo, please disregard, yet again, my latest pull request, sigh.
> >
> > Jiri, this could be something for tests/make, till then I'll try
> > to check this manually.
> 
> One question though: are you OK with the principle of having
> per-feature check flags? This brings two things to the feature
> detection and build:
> 1. the ability to specify specific flags for the feature check, which
> is not possible on the current code,
> 2. a simplification in the Makefiles.

looks good to me

jirka
Jean Pihet Dec. 3, 2013, 4:15 p.m. UTC | #5
I just resent the patches as v2.

I tested on x86_64, ARMv7 and ARMv8 with and without LIBUNWIND_DIR=
set in 'make -C tools/perf'. Can you check on your build setup?

Thanks,
Jean

On 29 November 2013 16:45, Jiri Olsa <jolsa@redhat.com> wrote:
> On Thu, Nov 28, 2013 at 09:02:23PM +0100, Jean Pihet wrote:
>> On 28 November 2013 14:46, Arnaldo Carvalho de Melo <acme@infradead.org> wrote:
>> > Em Thu, Nov 28, 2013 at 09:56:19AM -0300, Arnaldo Carvalho de Melo escreveu:
>> >> Em Thu, Nov 28, 2013 at 10:58:01AM +0100, Jiri Olsa escreveu:
>> >> > On Wed, Nov 27, 2013 at 11:43:23PM +0100, Jiri Olsa wrote:
>> >> > > On Wed, Nov 27, 2013 at 05:16:34PM -0300, Arnaldo Carvalho de Melo wrote:
>> >> > >   LINK     perf
>> >> > > /bin/ld: cannot find -lunwind
>> >> > > /bin/ld: cannot find -lunwind-x86_64
>> >> > > collect2: error: ld returned 1 exit status
>> >> > > make[1]: *** [perf] Error 1
>> >> > > make[1]: *** Waiting for unfinished jobs....
>> >> > > make: *** [all] Error 2
>> >>
>> >> > > I haven't checked this one.. will do tomorrow
>> >>
>> >> > we need to plug libunwind flags/libs only if
>> >> > the $(feature-libunwind) is enabled..
>> >>
>> >> > NO_LIBUNWIND - user's decision not to link with libunwind or
>> >> >                architecture that does not support it
>> >>
>> >> > $(feature-libunwind) - if it's actually installed
>> >>
>> >> > attached change fixies that for me, feel free to use/merge it
>> >>
>> >> Argh, I used tests/make on one machine where those two patches by Jean
>> >> were not applied, then rebased on another, the one I use to submit,
>> >> those got included but not tests/make tested, which probably explains
>> >> why this got thru :-\
>> >>
>> >> Jean, can you please check that this works for you on ARM too?
>> >
>> > I just noticed that this patch breaks the feature detection mechanism,
>> > after it is applied it is back performing all tests at every make call,
>> > this needs rethinking, so I'm dropping both.
>> Oh I am sorry about that. I tested on ARM with and without the
>> LIBUNWIND_DIR option set.
>> Let me rethink/rework this and come back to you with a proper fix.
>>
>> >
>> > Ingo, please disregard, yet again, my latest pull request, sigh.
>> >
>> > Jiri, this could be something for tests/make, till then I'll try
>> > to check this manually.
>>
>> One question though: are you OK with the principle of having
>> per-feature check flags? This brings two things to the feature
>> detection and build:
>> 1. the ability to specify specific flags for the feature check, which
>> is not possible on the current code,
>> 2. a simplification in the Makefiles.
>
> looks good to me
>
> jirka
diff mbox

Patch

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 80ea6d8..5f531db 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -345,12 +345,12 @@  ifndef NO_LIBUNWIND
       # non-ARM has no dwarf_find_debug_frame() function:
       CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
     endif
-  endif
 
-  CFLAGS += -DHAVE_LIBUNWIND_SUPPORT
-  EXTLIBS += $(LIBUNWIND_LIBS)
-  CFLAGS += $(LIBUNWIND_CFLAGS)
-  LDFLAGS += $(LIBUNWIND_LDFLAGS)
+    CFLAGS += -DHAVE_LIBUNWIND_SUPPORT
+    CFLAGS += $(LIBUNWIND_CFLAGS)
+    EXTLIBS += $(LIBUNWIND_LIBS)
+    LDFLAGS += $(LIBUNWIND_LDFLAGS)
+  endif # ifneq ($(feature-libunwind), 1)
 endif
 
 ifndef NO_LIBAUDIT