[Lldb-commits] [lldb] [LLDB][Telemetry]Define DebuggerTelemetryInfo and related methods (PR #127696)
Vy Nguyen via lldb-commits
lldb-commits at lists.llvm.org
Wed Feb 26 12:39:50 PST 2025
================
@@ -226,13 +227,45 @@ lldb::SBError SBDebugger::InitializeWithErrorHandling() {
return error;
}
+#if LLVM_ENABLE_TELEMETRY
+#if ENABLE_BACKTRACES
+static void TelemetryHandler(void *) {
+ // TODO: get the bt into the msg?
+ // Also need to pre-alloc the memory for this entry?
+ lldb_private::telemetry::DebuggerInfo entry;
+ entry.exit_desc = {-1, ""};
+ if (auto* instance = lldb_private::telemetry::TelemeryManager::getInstance()) {
+ if (instance->GetConfig()->EnableTelemetry()) {
+ instance->AtDebuggerExit(&entry);
+ }
+ }
+}
+
+static bool RegisterTelemetryHander() {
+ sys::AddSignalHandler(TelemetryHandler, nullptr);
+ return false;
+}
+#endif
+#endif
+
+static void InstallCrashTelemetryReporter() {
+#if LLVM_ENABLE_TELEMETRY
+
----------------
oontvoo wrote:
@labath Is this the right place to add the crash-handler?
https://github.com/llvm/llvm-project/pull/127696
More information about the lldb-commits
mailing list