]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Don't use the mutex for each symbol_set_names call
authorChristian Biesinger <cbiesinger@google.com>
Sat, 28 Sep 2019 23:44:43 +0000 (18:44 -0500)
committerChristian Biesinger <cbiesinger@google.com>
Tue, 1 Oct 2019 20:18:04 +0000 (15:18 -0500)
commit6ce6dd4b8c4862e7250dfad48965c303eb41af95
treec97f65bcc2329bbee26e6c0201d96aef17667017
parentfee9737afc7ef58153e8849640dac4f4d97feacc
Don't use the mutex for each symbol_set_names call

This avoids the lock contention that was seen with tromey's patch (it
moves it to a once- per-thread lock call from a once-per-symbol call).

It speeds up "attach to Chrome's content_shell binary" from 44 sec -> 30
sec (32%) (compared to GDB trunk), or from 37 sec compared to this
patchset before this patch.

gdb/ChangeLog:

2019-09-28  Christian Biesinger  <cbiesinger@google.com>

* minsyms.c (minimal_symbol_reader::install): Only do
demangling on the background thread; still call
symbol_set_names on the main thread.
* symtab.c (symbol_find_demangled_name): Make public,
so that minsyms.c can call it.
(symbol_set_names): Remove mutex. Avoid demangle call
if the demangled name is already set.
* symtab.h (symbol_find_demangled_name): Make public.
gdb/minsyms.c
gdb/symtab.c
gdb/symtab.h