[Mesa-dev] [PATCH 2/2] gallium/util: libunwind support

Rob Clark robdclark at gmail.com
Tue Apr 4 14:00:20 UTC 2017


On Tue, Apr 4, 2017 at 8:45 AM, Thomas Hellstrom <thellstrom at vmware.com> wrote:
> On 04/04/2017 02:34 PM, Rob Clark wrote:
>> On Tue, Apr 4, 2017 at 1:49 AM, Thomas Hellstrom <thellstrom at vmware.com> wrote:
>>> But one more worrying thing is that with these fixes, debug_flush gets
>>> too slow to be usable. I get about one frame every 5 seconds from Ubuntu
>>> compiz. The culprit seems to be unw_get_proc_name(). Is there a way we
>>> can save intermediate information during backtrace capture and call this
>>> function at printout time?
>>
>> btw, is it common to capture many more backtraces than you print?
>> (Just to check if defering the unw_get_proc_name() would actually help
>> anything..)
>
> Yes. The debug_flush functionality captures the backtrace on each map in
> case someone would flush when mapped or try a recursive map. Only then
> they are printed.
>
> FWIW in u_debug_symbol.c, José has implemented a hash table for name
> lookups. Perhaps one solution would to save the IP and insert the
> function name in the hash table with the IP as key.
>

fwiw, I added a hash-table:

https://github.com/freedreno/mesa/commits/wip-libunwind

It seems to work, but my hacked up test doesn't collect more
stacktraces than it prints so haven't really tested it from
performance standpoint.

Possibly it could re-use debug_symbol_name_cached() instead, or at
least not duplicate the hashtable..

BR,
-R


More information about the mesa-dev mailing list