================
@@ -761,12 +764,27 @@ void Debugger::InstanceInitialize() {
 
 DebuggerSP Debugger::CreateInstance(lldb::LogOutputCallback log_callback,
                                     void *baton) {
+  lldb_private::telemetry::ScopeTelemetryCollector helper;
   DebuggerSP debugger_sp(new Debugger(log_callback, baton));
+
+  if (helper.TelemetryEnabled()) {
+    helper.RunAtScopeExit([&]() {
+      lldb_private::telemetry::TelemetryManager *manager =
+          lldb_private::telemetry::TelemetryManager::GetInstance();
+      lldb_private::telemetry::DebuggerInfo entry;
+      entry.debugger = debugger_sp.get();
+      entry.start_time = helper.GetStartTime();
+      entry.end_time = helper.GetCurrentTime();
+      manager->AtDebuggerStartup(&entry);
----------------
JDevlieghere wrote:

Pavel's suggestion is to fill in the common fields, i.e. the ones in 
`LLDBBaseTelemetryInfo`. I expressed my dislike for the `AtDebuggerStartup` and 
friends in another PR, and if the distinction is important, I'd argue that they 
should be different events. With that, you could do this: 
https://godbolt.org/z/eazvPWs46



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