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

Thomas Hellstrom thellstrom at vmware.com
Tue Apr 4 16:10:27 UTC 2017


On 04/04/2017 05:36 PM, Rob Clark wrote:
> On Tue, Apr 4, 2017 at 10:28 AM, Thomas Hellstrom <thellstrom at vmware.com> wrote:
>> On 04/04/2017 04:06 PM, Rob Clark wrote:
>>> On Tue, Apr 4, 2017 at 10:00 AM, Rob Clark <robdclark at gmail.com> wrote:
>>>> 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://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_freedreno_mesa_commits_wip-2Dlibunwind&d=DwIFaQ&c=uilaK90D4TOVoH58JNXRgQ&r=wnSlgOCqfpNS4d02vP68_E9q2BNMCwfD2OZ_6dCFVQQ&m=VIINenNexQBSdAAjE5gNpegAuq9f_KOvkScYgqyZchQ&s=imNnOqL2QvjC7ok9q_QrCXSDr6AXpVgK4MYos9ZcyoM&e=
>>>>
>>>> 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..
>>>>
>> So, with your patches including the hash table, I'm up to speed again.
>> But addr2line.sh doesn't work.
>>
> Do you have an example of a stacktrace before addr2line.sh?  I'm
> trying to figure out the regexp's in that script but I guess it would
> be easier if I knew what it was matching against.
>
> BR,
> -R

Here it goes. I think what's translated by addr2line.sh is the part
starting the line up to the closing parentheses. The rest of the line is
let through as it is.

Reference of mapped buffer detected. Reference backtrace follows:
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x455b29) [0x7f344ece9b29]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x4561a4) [0x7f344ecea1a4]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x5320e1) [0x7f344edc60e1]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x53991a) [0x7f344edcd91a]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x53efae) [0x7f344edd2fae]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x540a46) [0x7f344edd4a46]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x5415cd) [0x7f344edd55cd]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x5417ff) [0x7f344edd57ff]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x56e181) [0x7f344ee02181]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x3fe1f1) [0x7f344ec921f1]
**********************************
Map backtrace follows:
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x455a4c) [0x7f344ece9a4c]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x455ef9) [0x7f344ece9ef9]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x531475) [0x7f344edc5475]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x535e40) [0x7f344edc9e40]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x553cbe) [0x7f344ede7cbe]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x56ee26) [0x7f344ee02e26]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x549d75) [0x7f344edddd75]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x487f98) [0x7f344ed1bf98]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x23e869) [0x7f344ead2869]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x1ef986) [0x7f344ea83986]
*********END OF MESSAGE***********


Might flush referenced mapped buffer detected. Might flush backtrace
follows:
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x455bd9) [0x7f344ece9bd9]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x46aa40) [0x7f344ecfea40]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x53232e) [0x7f344edc632e]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x536584) [0x7f344edca584]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x5399bc) [0x7f344edcd9bc]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x53eb0e) [0x7f344edd2b0e]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x540a46) [0x7f344edd4a46]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x5415cd) [0x7f344edd55cd]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x5417ff) [0x7f344edd57ff]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x56e181) [0x7f344ee02181]
**********************************
Map backtrace follows:
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x455a4c) [0x7f344ece9a4c]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x455ef9) [0x7f344ece9ef9]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x531475) [0x7f344edc5475]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x535e40) [0x7f344edc9e40]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x553cbe) [0x7f344ede7cbe]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x56ee26) [0x7f344ee02e26]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x549d75) [0x7f344edddd75]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x487f98) [0x7f344ed1bf98]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x23e869) [0x7f344ead2869]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x1ef986) [0x7f344ea83986]
**********************************
First reference backtrace follows:
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x4561fb) [0x7f344ecea1fb]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x5320e1) [0x7f344edc60e1]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x53991a) [0x7f344edcd91a]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x53efae) [0x7f344edd2fae]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x540a46) [0x7f344edd4a46]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x5415cd) [0x7f344edd55cd]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x5417ff) [0x7f344edd57ff]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x56e181) [0x7f344ee02181]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x3fe1f1) [0x7f344ec921f1]
    /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so(+0x3fd50e) [0x7f344ec9150e]
*********END OF MESSAGE***********

Thanks,

Thomas





More information about the mesa-dev mailing list