libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] unw_backtrace(): Performance slowdown for ARM?


From: Luke Diamand
Subject: Re: [Libunwind-devel] unw_backtrace(): Performance slowdown for ARM?
Date: Thu, 18 Jan 2018 22:22:43 +0000

Hi!

On 18 January 2018 at 12:00, Chris January <address@hidden> wrote:
> Hello Luke,
>
>
> On 18/01/18 07:53, Luke Diamand wrote:
>>
>> On 17 January 2018 at 15:55, Dave Watson <address@hidden> wrote:
>>>>>
>>>>> I didn't notice anything in particular looking at the commit logs.
>>>>> I'll try and repro when I get a chance
>>>>
>>>> arm_find_proc_info() seems to start out trying eh_frame tables. Isn't
>>>> it always best on ARM to start looking in the exidx tables?
>>>
>>> Sounds reasonable to me, although I'm not an arm expert.  Did the
>>> default change somewhere?  I couldn't find anything looking at the
>>> history.
>>
>> I'm definitely not an expert!
>>

....

>
> Whether the compiler generates a .eh_frame section or an .ARM.exidx
> section depends on the toolchain so a generic unwinder such as libunwind
> needs to support both.

OK, that makes sense.

>
> On aarch32 ARM libunwind also defaults to --enable-debug-frame=yes. This
> can cause libunwind to open and read the executable and any shared
> libraries every unwind if the .eh_frame section is missing or does not
> cover all addresses, which matches your comment that it is opening and
> closing files a lot. If you know you have .ARM.exidx sections then try
> configuring libunwind with --enable-debug-frame=no.

I've been building with --disable-debug-frame, which I assume does the
same thing (at least configure doesn't complain about it).

That results in defining CONFIG_DEBUG_FRAME, which cuts out a bit of
code from dwarf_find_unwind_table() and unw_step().

But arm_find_proc_info() will still call dwarf_find_proc_info(), which
will go and call dl_iterate_phdr() to try to find the DWARF unwind
tables on each and every call.

Do we just need something like this:

@@ -528,8 +527,10 @@ arm_find_proc_info (unw_addr_space_t as, unw_word_t ip,

   Debug (14, "looking for IP=0x%lx\n", (long) ip);

+#ifdef CONFIG_DEBUG_FRAME
   if (UNW_TRY_METHOD(UNW_ARM_METHOD_DWARF))
     ret = dwarf_find_proc_info (as, ip, pi, need_unwind_info, arg);
+#endif

   if (ret < 0 && UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX))
     {


Luke



reply via email to

[Prev in Thread] Current Thread [Next in Thread]