[Lldb-commits] [lldb] Fix statistics dump to report per-target (PR #113723)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 25 12:50:56 PDT 2024


================
@@ -236,6 +236,27 @@ void TargetStats::IncreaseSourceRealpathCompatibleCount(uint32_t count) {
 
 bool DebuggerStats::g_collecting_stats = false;
 
+void DebuggerStats::ResetStatistics(Debugger &debugger, Target *target) {
+  const uint64_t num_modules = target != nullptr
+                                   ? target->GetImages().GetSize()
+                                   : Module::GetNumberAllocatedModules();
+  for (size_t image_idx = 0; image_idx < num_modules; ++image_idx) {
+    Module *module = target != nullptr
+                         ? target->GetImages().GetModuleAtIndex(image_idx).get()
+                         : Module::GetAllocatedModuleAtIndex(image_idx);
+    if (module == nullptr)
+      continue;
+    ModuleStats module_stat;
+    module->GetSymtabParseTime().reset();
+    module->GetSymtabIndexTime().reset();
----------------
clayborg wrote:

Just call `module->ResetStatistics();`

https://github.com/llvm/llvm-project/pull/113723


More information about the lldb-commits mailing list