[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 5 20:52:03 PST 2024


================
@@ -198,16 +198,24 @@ SBDebugger SBTarget::GetDebugger() const {
 }
 
 SBStructuredData SBTarget::GetStatistics() {
+   LLDB_INSTRUMENT_VA(this);
+  SBStatisticsOptions options;
+  options.SetSummaryOnly(false);
+  return GetStatistics(options);
+}
+
+SBStructuredData SBTarget::GetStatistics(SBStatisticsOptions options) {
   LLDB_INSTRUMENT_VA(this);
 
   SBStructuredData data;
   TargetSP target_sp(GetSP());
   if (!target_sp)
     return data;
   std::string json_str =
-      llvm::formatv("{0:2}",
-          DebuggerStats::ReportStatistics(target_sp->GetDebugger(),
-                                          target_sp.get())).str();
+      llvm::formatv(
+          "{0:2}", DebuggerStats::ReportStatistics(
+                       target_sp->GetDebugger(), target_sp.get(), options.GetStatisticsOptions()))
----------------
clayborg wrote:

```
target_sp->GetDebugger(), target_sp.get(), options.ref()))
```

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


More information about the lldb-commits mailing list