llvm-project/lldb/source/Target
Pavel Labath 4f89157b9d [lldb] Make StatsDuration thread-safe
std::chrono::duration types are not thread-safe, and they cannot be
concurrently updated from multiple threads. Currently, we were doing
such a thing (only) in the DWARF indexing code
(DWARFUnit::ExtractDIEsRWLocked), but I think it can easily happen that
someone else tries to update another statistic like this without
bothering to check for thread safety.

This patch changes the StatsDuration type from a simple typedef into a
class in its own right. The class stores the duration internally as
std::atomic<uint64_t> (so it can be updated atomically), but presents it
to its users as the usual chrono type (duration<float>).

Differential Revision: https://reviews.llvm.org/D117474
2022-01-19 16:42:53 +01:00
..
ABI.cpp [lldb] [ABI] Apply AugmentRegisterInfo() to DynamicRegisterInfo::Registers 2021-10-11 17:02:26 +02:00
AssertFrameRecognizer.cpp [lldb] Fix Recognizer/assert.test with glibc-2.33.9000-31.fc35.x86_64 2021-07-01 09:16:07 +02:00
CMakeLists.txt Modify "statistics dump" to dump JSON. 2021-10-21 12:14:21 -07:00
DynamicRegisterInfo.cpp [lldb] [DynamicRegisterInfo] Remove AddRegister() and make Finalize() protected 2021-10-25 20:05:30 +02:00
ExecutionContext.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
InstrumentationRuntime.cpp
InstrumentationRuntimeStopInfo.cpp
JITLoader.cpp
JITLoaderList.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
Language.cpp [lldb] Tighten lock in Language::ForEach 2021-08-31 15:45:38 -07:00
LanguageRuntime.cpp Add setting to disable LanguageRuntime UnwindPlans 2021-04-08 13:28:59 -07:00
Memory.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
MemoryHistory.cpp
MemoryRegionInfo.cpp [lldb][AArch64/Linux] Show memory tagged memory regions 2020-11-20 11:21:59 +00:00
ModuleCache.cpp [lldb] [gdb-remote] Add eOpenOptionReadWrite for future gdb compat 2021-08-09 12:06:59 +02:00
OperatingSystem.cpp [lldb] Remove ConstString from GetPluginNameStatic of some plugins 2021-10-21 12:58:45 +02:00
PathMappingList.cpp [lldb][NFC] avoid unnecessary roundtrips between different string types 2021-11-01 22:15:01 -07:00
Platform.cpp [lldb] Introduce SBPlatform::SetSDKRoot 2022-01-19 12:49:47 +01:00
Process.cpp Revert "Reland "[lldb] Remove non address bits when looking up memory regions"" 2021-11-26 15:35:02 +00:00
ProcessTrace.cpp [lldb] Remove ConstString from Process, ScriptInterpreter and StructuredData plugin names 2021-10-28 10:15:03 +02:00
Queue.cpp
QueueItem.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
QueueList.cpp
RegisterContext.cpp Recommit: [lldb] Remove "dwarf dynamic register size expressions" from RegisterInfo 2021-10-07 11:15:00 +02:00
RegisterContextUnwind.cpp Remove redundant string initialization (NFC) 2021-12-26 09:39:26 -08:00
RegisterNumber.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
RemoteAwarePlatform.cpp [lldb] Move GetSupportedArchitectureAtIndex to PlatformDarwin 2021-11-24 15:48:23 +01:00
SectionLoadHistory.cpp
SectionLoadList.cpp
StackFrame.cpp [lldb/Target] Refine source display warning for artificial locations (NFC) 2021-12-09 14:38:14 -08:00
StackFrameList.cpp [lldb] [gdb-remote server] Introduce new stop reasons for fork and vfork 2021-04-24 11:08:33 +02:00
StackFrameRecognizer.cpp
StackID.cpp
Statistics.cpp [lldb] Make StatsDuration thread-safe 2022-01-19 16:42:53 +01:00
StopInfo.cpp [lldb][NFC] Inclusive Language: rename master plan to controlling plan 2021-11-11 15:04:44 -06:00
StructuredDataPlugin.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
SystemRuntime.cpp
Target.cpp [lldb] Create a property to store the REPL language 2022-01-05 15:03:46 -08:00
TargetList.cpp [lldb] Add missing mutex guards to TargetList::CreateTarget 2021-05-24 19:49:57 +02:00
TargetProperties.td [lldb] Remove non-stop mode code 2021-09-28 14:13:50 +02:00
Thread.cpp Remove redundant void arguments (NFC) 2022-01-02 10:20:19 -08:00
ThreadCollection.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
ThreadList.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
ThreadPlan.cpp [lldb][NFC] Inclusive Language: rename master plan to controlling plan 2021-11-11 15:04:44 -06:00
ThreadPlanBase.cpp [lldb][NFC] Inclusive Language: rename master plan to controlling plan 2021-11-11 15:04:44 -06:00
ThreadPlanCallFunction.cpp [lldb][NFC] Inclusive Language: rename master plan to controlling plan 2021-11-11 15:04:44 -06:00
ThreadPlanCallFunctionUsingABI.cpp
ThreadPlanCallOnFunctionExit.cpp [lldb][NFC] Inclusive Language: rename master plan to controlling plan 2021-11-11 15:04:44 -06:00
ThreadPlanCallUserExpression.cpp [lldb][NFC] Inclusive Language: rename master plan to controlling plan 2021-11-11 15:04:44 -06:00
ThreadPlanPython.cpp [lldb] Clarify StructuredDataImpl ownership 2021-12-13 21:04:51 +01:00
ThreadPlanRunToAddress.cpp
ThreadPlanShouldStopHere.cpp
ThreadPlanStack.cpp Remove redundant return and continue statements (NFC) 2021-12-24 23:17:54 -08:00
ThreadPlanStepInRange.cpp [lldb][NFC] Remove all uses of StringRef::withNullAsEmpty in LLDB 2021-05-18 09:41:20 +02:00
ThreadPlanStepInstruction.cpp [lldb] Rename {stop,run}_vote to report_{stop,run}_vote 2021-02-19 13:04:53 -08:00
ThreadPlanStepOut.cpp [lldb] Rename {stop,run}_vote to report_{stop,run}_vote 2021-02-19 13:04:53 -08:00
ThreadPlanStepOverBreakpoint.cpp [lldb] Avoid moving ThreadPlanSP from plans vector 2021-08-01 10:40:04 -07:00
ThreadPlanStepOverRange.cpp
ThreadPlanStepRange.cpp Target::ReadMemory read from read-only binary file Section, not memory 2021-04-16 16:13:07 -07:00
ThreadPlanStepThrough.cpp [lldb] Remove very old misleading comment (NFC) 2021-02-15 18:14:57 -08:00
ThreadPlanStepUntil.cpp
ThreadPlanTracer.cpp [lldb] Remove unused ThreadPlan tracer utilities (NFC) 2021-02-15 17:59:25 -08:00
ThreadSpec.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
Trace.cpp [lldb] Remove ConstString from SymbolVendor, Trace, TraceExporter, UnwindAssembly, MemoryHistory and InstrumentationRuntime plugin names 2021-10-29 12:08:57 +02:00
TraceCursor.cpp [trace][intel pt] Implement the Intel PT cursor 2021-07-16 16:47:43 -07:00
TraceExporter.cpp [lldb] Remove ConstString from SymbolVendor, Trace, TraceExporter, UnwindAssembly, MemoryHistory and InstrumentationRuntime plugin names 2021-10-29 12:08:57 +02:00
TraceInstructionDumper.cpp Fix clang-tidy bugprone-argument-comment that was mixed up 2022-01-11 11:12:28 -08:00
UnixSignals.cpp Add unix signal hit counts to the target statistics. 2021-10-27 22:31:14 -07:00
UnwindAssembly.cpp [lldb] Delete copy operations on PluginInterface class 2020-10-09 10:37:09 +02:00
UnwindLLDB.cpp Remove redundant return and continue statements (NFC) 2021-12-24 23:17:54 -08:00