Remove an expensive lock from Timer
authorPavel Labath <labath@google.com>
Mon, 15 May 2017 13:02:37 +0000 (13:02 +0000)
committerPavel Labath <labath@google.com>
Mon, 15 May 2017 13:02:37 +0000 (13:02 +0000)
commitf9d16476573e16856bdb3250c817b0a2c631d2b1
tree7cae9a3d7fb178078ab0e4990ebf991c93679c08
parent3030bf0c816b136c97d8c69ca8b38e394eefd5d2
Remove an expensive lock from Timer

The Timer destructor would grab a global mutex in order to update
execution time. Add a class to define a category once, statically; the
class adds itself to an atomic singly linked list, and thus subsequent
updates only need to use an atomic rather than grab a lock and perform a
hashtable lookup.

Differential Revision: https://reviews.llvm.org/D32823
Patch by Scott Smith <scott.smith@purestorage.com>.

llvm-svn: 303058
28 files changed:
lldb/include/lldb/Core/Timer.h
lldb/source/API/SystemInitializerFull.cpp
lldb/source/Commands/CommandObjectTarget.cpp
lldb/source/Core/Disassembler.cpp
lldb/source/Core/Mangled.cpp
lldb/source/Core/Module.cpp
lldb/source/Core/Timer.cpp
lldb/source/Host/common/Symbols.cpp
lldb/source/Initialization/SystemInitializerCommon.cpp
lldb/source/Interpreter/CommandInterpreter.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
lldb/source/Symbol/DWARFCallFrameInfo.cpp
lldb/source/Symbol/ObjectFile.cpp
lldb/source/Symbol/Symtab.cpp
lldb/source/Target/Target.cpp
lldb/source/Target/TargetList.cpp
lldb/unittests/Core/TimerTest.cpp