clayborg added inline comments.

================
Comment at: lldb/include/lldb/Target/Statistics.h:96
+};
+
+class GlobalStats {
----------------
JDevlieghere wrote:
> Do we expect there to be something like `DebuggerStats`? I think it would be 
> nice from a hierarchy perspective that Global Stats have a map of debugger -> 
> to debuggerstat who then in turn hold on to a map of target -> target stats. 
> That hierarchy would work really well for JSON (except they would be lists 
> instead of maps). 
I can change this to DebuggerStats as this is essentially what this was.


================
Comment at: lldb/include/lldb/Target/Statistics.h:114
+  static bool g_collecting_stats;
+};
+
----------------
This can be expensive if you start locking a mutex just to increment a stat 
that is a counter and will make statistics slow down the debugger. I would 
rather rely on std::atomic or the locks already built into Target or Debugger 
if possible. If lldb_asserts are firing off at a high rate, we can't be 
spending thousands of instructions locking and unlocking mutexes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111686/new/

https://reviews.llvm.org/D111686

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to