summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/SymbolVendor
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-05-15 13:02:37 +0000
committerPavel Labath <labath@google.com>2017-05-15 13:02:37 +0000
commitcfccbd2ba74f607e21897c4dbb09146f5d47f0e8 (patch)
tree3d781caf954c00ef655fb746beebf4008d54623c /lldb/source/Plugins/SymbolVendor
parent60fcaa3311322a762fb2aad2dbf167d2577873e1 (diff)
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>.
Diffstat (limited to 'lldb/source/Plugins/SymbolVendor')
-rw-r--r--lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
index 363fba2b0bb..5a377d7b04f 100644
--- a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -92,8 +92,8 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
if (file_spec_list.IsEmpty())
return NULL;
- Timer scoped_timer(LLVM_PRETTY_FUNCTION,
- "SymbolVendorELF::CreateInstance (module = %s)",
+ static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
+ Timer scoped_timer(func_cat, "SymbolVendorELF::CreateInstance (module = %s)",
module_sp->GetFileSpec().GetPath().c_str());
for (size_t idx = 0; idx < file_spec_list.GetSize(); ++idx) {