================
@@ -73,6 +147,10 @@ class TelemetryManager : public llvm::telemetry::Manager {
 
 private:
   std::unique_ptr<llvm::telemetry::Config> m_config;
+  // Each debugger is assigned a unique ID (session_id).
+  // All TelemetryInfo entries emitted for the same debugger instance
+  // will get the same session_id.
+  llvm::DenseMap<Debugger *, std::string> session_ids;
----------------
labath wrote:

I think it could work, but I do believe its error-prone -- and maybe also 
unnecessary. I think we could avoid all this is we make the unique identifier 
of a debugger a pair. The first component would be the identifier of the 
TelemetryManager instance, generated when it's constructed (using random data, 
current time stamp, or whatever). The second component could the debugger ID 
(as retrieved by `debugger->GetID()`, which is a sequentially increasing 
integer). Then we don't need to store any per-debugger data,

The second component guarantees uniqueness of the identifier within a single 
process, the second does it "globally". If a particular backend doesn't like 
the fact that this is a pair, it can just concatenate them.

https://github.com/llvm/llvm-project/pull/127696
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to