2014-02-03 15:28:09

by Jean Pihet

[permalink] [raw]
Subject: Re: [Libunwind-devel] [RFC PATCH 0/3] Add support for dwarf compat mode unwinding

Hi Arun,

On 22 January 2014 06:15, Arun Sharma <[email protected]> wrote:
> On Tue, Jan 21, 2014 at 12:16 AM, Jean Pihet <[email protected]> wrote:
>
>>>> This is the case when e.g. profiling an ARMv7 binary that runs on an
>>>> ARMv8 (aka AARCH64) platform.
>>>
>>> Why not configure libunwind for ARMv7 in that case?
>>>
>>> I'm trying to understand how is your use case different from using
>>> x86_32 libunwind to do local unwinding on a x86_64 machine.
>> Can you give more details on the use case and how to configure
>> libunwind?
>
> You could either build libunwind on a ARMv7 machine and copy it over
> or setup a 32 bit chroot on a 64 bit kernel and compile libunwind
> inside that.
>
>> The provided patches dynamically detect the target binary
>> address size and parse the debug info accordingly, all that in a
>> single library.
>
> This is generally called cross-unwinding in libunwind lingo. Some
> description here:
>
> http://www.nongnu.org/libunwind/man/libunwind%283%29.html#section_4
>
>>
>> Note: my use case is to call libunwind from the perf utility in order
>> to unwind from the dwarf info.
>>
>
> You could link in two copies of libunwind into the perf binary:
> * libunwind.a for local (host == target) unwinding
> * libunwind-arm.a for 32 bit cross-unwinding
>
> Doing cross-unwinding requires you to write a bunch of "accessors" on
> how to access the address space of a non-local thread.
>
> Something like ./configure --target=arm on aarch64.

Thanks for the link and info.

Is there a concrete example of cross-unwinding with multiple targets,
for example on x86_64 using native and x86_32 libunwind libraries
simultaneously?
I am trying to assess the impact of multiple unwinding libs in the perf code.

Jiri, Arnaldo,
How is that done on x86? I do not think this can be done with the
current perf code, am I correct?

>
> -Arun

Regards,
Jean


2014-02-03 15:58:57

by Arun Sharma

[permalink] [raw]
Subject: Re: [Libunwind-devel] [RFC PATCH 0/3] Add support for dwarf compat mode unwinding

On Mon, Feb 3, 2014 at 7:28 AM, Jean Pihet <[email protected]> wrote:

>> Something like ./configure --target=arm on aarch64.
>
> Thanks for the link and info.
>
> Is there a concrete example of cross-unwinding with multiple targets,
> for example on x86_64 using native and x86_32 libunwind libraries
> simultaneously?
> I am trying to assess the impact of multiple unwinding libs in the perf code.

Might want to check with folks who worked on Frysk. There was some
criticism that it was non-trivial, but it's been done.

http://lists.nongnu.org/archive/html/libunwind-devel/2007-05/msg00006.html

-Arun

2014-02-03 16:39:29

by Jiri Olsa

[permalink] [raw]
Subject: Re: [Libunwind-devel] [RFC PATCH 0/3] Add support for dwarf compat mode unwinding

On Mon, Feb 03, 2014 at 04:28:06PM +0100, Jean Pihet wrote:
> Hi Arun,
>
> On 22 January 2014 06:15, Arun Sharma <[email protected]> wrote:
> > On Tue, Jan 21, 2014 at 12:16 AM, Jean Pihet <[email protected]> wrote:
> >
> >>>> This is the case when e.g. profiling an ARMv7 binary that runs on an
> >>>> ARMv8 (aka AARCH64) platform.
> >>>
> >>> Why not configure libunwind for ARMv7 in that case?
> >>>
> >>> I'm trying to understand how is your use case different from using
> >>> x86_32 libunwind to do local unwinding on a x86_64 machine.
> >> Can you give more details on the use case and how to configure
> >> libunwind?
> >
> > You could either build libunwind on a ARMv7 machine and copy it over
> > or setup a 32 bit chroot on a 64 bit kernel and compile libunwind
> > inside that.
> >
> >> The provided patches dynamically detect the target binary
> >> address size and parse the debug info accordingly, all that in a
> >> single library.
> >
> > This is generally called cross-unwinding in libunwind lingo. Some
> > description here:
> >
> > http://www.nongnu.org/libunwind/man/libunwind%283%29.html#section_4
> >
> >>
> >> Note: my use case is to call libunwind from the perf utility in order
> >> to unwind from the dwarf info.
> >>
> >
> > You could link in two copies of libunwind into the perf binary:
> > * libunwind.a for local (host == target) unwinding
> > * libunwind-arm.a for 32 bit cross-unwinding
> >
> > Doing cross-unwinding requires you to write a bunch of "accessors" on
> > how to access the address space of a non-local thread.
> >
> > Something like ./configure --target=arm on aarch64.
>
> Thanks for the link and info.
>
> Is there a concrete example of cross-unwinding with multiple targets,
> for example on x86_64 using native and x86_32 libunwind libraries
> simultaneously?
> I am trying to assess the impact of multiple unwinding libs in the perf code.
>
> Jiri, Arnaldo,
> How is that done on x86? I do not think this can be done with the
> current perf code, am I correct?

correct, but it sounds cool ;-)

jirka