[Lldb-commits] [lldb] [LLDB][Telemetry] Collect telemetry from client when allowed. (PR #129728)

Vy Nguyen via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 3 07:00:04 PDT 2025


================
@@ -965,6 +965,22 @@ SBTarget SBDebugger::GetDummyTarget() {
   return sb_target;
 }
 
+void SBDebugger::DispatchClientTelemetry(const lldb::SBStructuredData &entry) {
+  LLDB_INSTRUMENT_VA(this);
+  // Disable client-telemetry for SWIG.
+  // This prevent arbitrary python client (pretty printers, whatnot) from sending
+  // telemetry without vendors knowing.
+#ifndef SWIG
----------------
oontvoo wrote:

Ah, ok - now that you mentioned it - I agree we should avoid the #ifdef thing on function decl (missing function def and whatnot).

Can we consider going back to my previous impl, which put the ifdef in the function's definition so that the function either does nothing (when client-telemetry is disabled) or actually dispatches the data to server?
But yes, we can modify the ifdef there - rather than conditioning on SWIG, we just make it an explicit `ENABLE_CLIENT_TELEMETRY`. 
Why wasn't that sufficient? 

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


More information about the lldb-commits mailing list