diff mbox

[3/4] perf tools: Check libunwind for availability of dwarf parsing feature

Message ID 1379323053-11458-4-git-send-email-jean.pihet@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Jean Pihet Sept. 16, 2013, 9:17 a.m. UTC
The newly added dwarf unwinding feature [1] requires:
. a recent version (>= 1.1) of libunwind,
. libunwind to be configured with --enable-debug-frame.

[1] http://www.spinics.net/lists/kernel/msg1598951.html

Add the corresponding API test in the feature check list.

Signed-off-by: Jean Pihet <jean.pihet@linaro.org>
---
 tools/perf/config/Makefile          |  2 +-
 tools/perf/config/feature-tests.mak | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

Comments

Will Deacon Sept. 17, 2013, 10:29 a.m. UTC | #1
Arnaldo, Ingo,

On Mon, Sep 16, 2013 at 10:17:32AM +0100, Jean Pihet wrote:
> The newly added dwarf unwinding feature [1] requires:
> . a recent version (>= 1.1) of libunwind,
> . libunwind to be configured with --enable-debug-frame.
> 
> [1] http://www.spinics.net/lists/kernel/msg1598951.html
> 
> Add the corresponding API test in the feature check list.
> 
> Signed-off-by: Jean Pihet <jean.pihet@linaro.org>
> ---
>  tools/perf/config/Makefile          |  2 +-
>  tools/perf/config/feature-tests.mak | 11 ++++++++++-
>  2 files changed, 11 insertions(+), 2 deletions(-)

Can I have an ack for this and the following patch please?

(http://lists.infradead.org/pipermail/linux-arm-kernel/2013-September/198531.html)

Then I can stick these into -next for some more exposure before I queue them
for 3.13.

Cheers,

Will
Jean Pihet Sept. 24, 2013, 8:55 a.m. UTC | #2
Hin

On 17 September 2013 12:29, Will Deacon <will.deacon@arm.com> wrote:
> Arnaldo, Ingo,
>
> On Mon, Sep 16, 2013 at 10:17:32AM +0100, Jean Pihet wrote:
>> The newly added dwarf unwinding feature [1] requires:
>> . a recent version (>= 1.1) of libunwind,
>> . libunwind to be configured with --enable-debug-frame.
>>
>> [1] http://www.spinics.net/lists/kernel/msg1598951.html
>>
>> Add the corresponding API test in the feature check list.
>>
>> Signed-off-by: Jean Pihet <jean.pihet@linaro.org>
>> ---
>>  tools/perf/config/Makefile          |  2 +-
>>  tools/perf/config/feature-tests.mak | 11 ++++++++++-
>>  2 files changed, 11 insertions(+), 2 deletions(-)
>
> Can I have an ack for this and the following patch please?
>
> (http://lists.infradead.org/pipermail/linux-arm-kernel/2013-September/198531.html)
>
> Then I can stick these into -next for some more exposure before I queue them
> for 3.13.
>
> Cheers,
>
> Will

Ping on the series. The two patches above (3/4 and 4/4) are generic
while the two others are impacting ARM only.
Is it possible to get an Ack for the generic ones?

Kind regards,
Jean
Jiri Olsa Sept. 24, 2013, 9:34 a.m. UTC | #3
On Tue, Sep 24, 2013 at 10:55:32AM +0200, Jean Pihet wrote:
> Hin
> 
> On 17 September 2013 12:29, Will Deacon <will.deacon@arm.com> wrote:
> > Arnaldo, Ingo,
> >
> > On Mon, Sep 16, 2013 at 10:17:32AM +0100, Jean Pihet wrote:
> >> The newly added dwarf unwinding feature [1] requires:
> >> . a recent version (>= 1.1) of libunwind,
> >> . libunwind to be configured with --enable-debug-frame.
> >>
> >> [1] http://www.spinics.net/lists/kernel/msg1598951.html
> >>
> >> Add the corresponding API test in the feature check list.
> >>
> >> Signed-off-by: Jean Pihet <jean.pihet@linaro.org>
> >> ---
> >>  tools/perf/config/Makefile          |  2 +-
> >>  tools/perf/config/feature-tests.mak | 11 ++++++++++-
> >>  2 files changed, 11 insertions(+), 2 deletions(-)
> >
> > Can I have an ack for this and the following patch please?
> >
> > (http://lists.infradead.org/pipermail/linux-arm-kernel/2013-September/198531.html)
> >
> > Then I can stick these into -next for some more exposure before I queue them
> > for 3.13.
> >
> > Cheers,
> >
> > Will
> 
> Ping on the series. The two patches above (3/4 and 4/4) are generic
> while the two others are impacting ARM only.
> Is it possible to get an Ack for the generic ones?

I'm fine with those changes.. still I'm sort of worried about
current DWARF unwind users (but not sure if there're any),
who depends on packaged libunwind compiled without
--enable-debug-frame option.

I've seen your libunwind patch to make it default, but
not sure if it was accepted.. if not, maybe we should
detect this and build that code conditionaly.

thoughts anyone?
jirka
Will Deacon Sept. 24, 2013, 10:06 a.m. UTC | #4
On Tue, Sep 24, 2013 at 10:34:50AM +0100, Jiri Olsa wrote:
> On Tue, Sep 24, 2013 at 10:55:32AM +0200, Jean Pihet wrote:
> > Ping on the series. The two patches above (3/4 and 4/4) are generic
> > while the two others are impacting ARM only.
> > Is it possible to get an Ack for the generic ones?
> 
> I'm fine with those changes.. still I'm sort of worried about
> current DWARF unwind users (but not sure if there're any),
> who depends on packaged libunwind compiled without
> --enable-debug-frame option.

Since x86 is the only architecture using libunwind with perf at the moment,
and I'd expect it to use .eh_frame for unwinding, I'm also not sure there
are any existing users to worry about.

> I've seen your libunwind patch to make it default, but
> not sure if it was accepted.. if not, maybe we should
> detect this and build that code conditionaly.

It certainly defaults to "on" for ARM, but other architectures have to
enable it explicitly afaict.

Will
Jean Pihet Sept. 24, 2013, 12:03 p.m. UTC | #5
Hi Jiri, Will,

On 24 September 2013 12:06, Will Deacon <will.deacon@arm.com> wrote:
> On Tue, Sep 24, 2013 at 10:34:50AM +0100, Jiri Olsa wrote:
>> On Tue, Sep 24, 2013 at 10:55:32AM +0200, Jean Pihet wrote:
>> > Ping on the series. The two patches above (3/4 and 4/4) are generic
>> > while the two others are impacting ARM only.
>> > Is it possible to get an Ack for the generic ones?
>>
>> I'm fine with those changes.. still I'm sort of worried about
>> current DWARF unwind users (but not sure if there're any),
>> who depends on packaged libunwind compiled without
>> --enable-debug-frame option.
>
> Since x86 is the only architecture using libunwind with perf at the moment,
> and I'd expect it to use .eh_frame for unwinding, I'm also not sure there
> are any existing users to worry about.
Right

>
>> I've seen your libunwind patch to make it default, but
>> not sure if it was accepted.. if not, maybe we should
>> detect this and build that code conditionaly.
>
> It certainly defaults to "on" for ARM, but other architectures have to
> enable it explicitly afaict.
Yes that is correct.
This patch (3/4) detects if the debug frame code is enabled in
libunwind and uses the lib only if it is the case.
Users that want the feature have to enable it explicitly; the commit
description documents how to do that.

So I think we are safe here.

>
> Will

Thanks,
Jean
Arnaldo Carvalho de Melo Sept. 24, 2013, 5:12 p.m. UTC | #6
Em Tue, Sep 17, 2013 at 11:29:04AM +0100, Will Deacon escreveu:
> Arnaldo, Ingo,
> 
> On Mon, Sep 16, 2013 at 10:17:32AM +0100, Jean Pihet wrote:
> > The newly added dwarf unwinding feature [1] requires:
> > . a recent version (>= 1.1) of libunwind,
> > . libunwind to be configured with --enable-debug-frame.
> > 
> > [1] http://www.spinics.net/lists/kernel/msg1598951.html
> > 
> > Add the corresponding API test in the feature check list.
> > 
> > Signed-off-by: Jean Pihet <jean.pihet@linaro.org>
> > ---
> >  tools/perf/config/Makefile          |  2 +-
> >  tools/perf/config/feature-tests.mak | 11 ++++++++++-
> >  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> Can I have an ack for this and the following patch please?
> 
> (http://lists.infradead.org/pipermail/linux-arm-kernel/2013-September/198531.html)
> 
> Then I can stick these into -next for some more exposure before I queue them
> for 3.13.

I can pick it now that Jiri kinda acked it, right Jiri?

- Arnaldo
Will Deacon Sept. 30, 2013, 4:01 p.m. UTC | #7
Hi Arnaldo,

On Tue, Sep 24, 2013 at 06:12:20PM +0100, Arnaldo Carvalho de Melo wrote:
> Em Tue, Sep 17, 2013 at 11:29:04AM +0100, Will Deacon escreveu:
> > Arnaldo, Ingo,
> > 
> > On Mon, Sep 16, 2013 at 10:17:32AM +0100, Jean Pihet wrote:
> > > The newly added dwarf unwinding feature [1] requires:
> > > . a recent version (>= 1.1) of libunwind,
> > > . libunwind to be configured with --enable-debug-frame.
> > > 
> > > [1] http://www.spinics.net/lists/kernel/msg1598951.html
> > > 
> > > Add the corresponding API test in the feature check list.
> > > 
> > > Signed-off-by: Jean Pihet <jean.pihet@linaro.org>
> > > ---
> > >  tools/perf/config/Makefile          |  2 +-
> > >  tools/perf/config/feature-tests.mak | 11 ++++++++++-
> > >  2 files changed, 11 insertions(+), 2 deletions(-)
> > 
> > Can I have an ack for this and the following patch please?
> > 
> > (http://lists.infradead.org/pipermail/linux-arm-kernel/2013-September/198531.html)
> > 
> > Then I can stick these into -next for some more exposure before I queue them
> > for 3.13.
> 
> I can pick it now that Jiri kinda acked it, right Jiri?

Jiri ended up acking v3 of the patches:

http://lists.infradead.org/pipermail/linux-arm-kernel/2013-September/200579.html

but I don't see them in -next. I'm happy to take them via my tree, just want
to make sure they don't conflict with anything you have planned for 3.13
and/or end up with our trees colliding in -next.

What's the plan?

Cheers,

Will
diff mbox

Patch

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 4b65710..395bc41 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -223,7 +223,7 @@  endif
 
 FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(CFLAGS) $(LIBUNWIND_LDFLAGS) $(LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS)
 ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y)
-  msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99);
+  msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1);
   NO_LIBUNWIND := 1
 endif # Libunwind support
 endif # NO_LIBUNWIND
diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak
index 708fb8e..87124d0 100644
--- a/tools/perf/config/feature-tests.mak
+++ b/tools/perf/config/feature-tests.mak
@@ -176,14 +176,23 @@  extern int UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as,
                                       unw_proc_info_t *pi,
                                       int need_unwind_info, void *arg);
 
-
 #define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table)
 
+extern int
+UNW_OBJ(dwarf_find_debug_frame) (int found, unw_dyn_info_t *di_debug,
+				 unw_word_t ip,
+				 unw_word_t segbase,
+				 const char *obj_name, unw_word_t start,
+				 unw_word_t end);
+
+#define dwarf_find_debug_frame UNW_OBJ(dwarf_find_debug_frame)
+
 int main(void)
 {
 	unw_addr_space_t addr_space;
 	addr_space = unw_create_addr_space(NULL, 0);
 	unw_init_remote(NULL, addr_space, NULL);
+	dwarf_find_debug_frame(0, NULL, 0, 0, NULL, 0, 0);
 	dwarf_search_unwind_table(addr_space, 0, NULL, NULL, 0, NULL);
 	return 0;
 }