[Top][All Lists]

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

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

From: Chris January
Subject: Re: [Libunwind-devel] unw_backtrace(): Performance slowdown for ARM?
Date: Fri, 19 Jan 2018 09:33:22 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

Hello Luke,

On 18/01/18 22:22, Luke Diamand wrote:

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);

      ret = dwarf_find_proc_info (as, ip, pi, need_unwind_info, arg);

The dwarf_find_proc_info looks for .eh_frame as well as .debug_frame, so
it wouldn't be appropriate to wrap it in a CONFIG_DEBUG_FRAME guard.

Although libunwind, as a generic unwinder, needs to support both
.eh_frame and .ARM.exidx, a particular distribution that is built with a
particular toolchain is most likely only going to use one or the other.
The unwinders that libunwind tries on ARM can be controlled at runtime
using the UNW_ARM_UNWIND_METHOD environment variable, as you know, but
if a distribution only uses one and sticks with it, then it would make
sense to add an option to libunwind's configure to control the choice at
configure time -- i.e. to set the default value of unwi_unwind_method in


IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.

reply via email to

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