]> 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>
Thu, 3 Oct 2019 18:15:36 +0000 (13:15 -0500)
commite1f6a52ca259c3b9bb4b90022f77ee5c99743ccc
treed07845861e22e42cc11c0fad6124134e28657296
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 50 sec -> 30
sec (32%).

See https://sourceware.org/ml/gdb-patches/2019-10/msg00087.html for some
more speed measurements.

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