[Lldb-commits] [lldb] [llvm] [llvm][telemetry]Change Telemetry-disabling mechanism. (PR #128534)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 25 01:14:21 PST 2025


================
@@ -64,11 +64,19 @@ class Serializer {
 /// This struct can be extended as needed to add additional configuration
 /// points specific to a vendor's implementation.
 struct Config {
-  virtual ~Config() = default;
+#ifdef LLVM_ENABLE_TELEMETRY
+  static const bool BuildTimeEnableTelemetry = true;
+#else
+  static const bool BuildTimeEnableTelemetry = false;
+#endif
+  virtual ~Config() : EnableTelemetry(BuildTimeEnableTelemetry) {}
 
   // If true, telemetry will be enabled.
   const bool EnableTelemetry;
-  Config(bool E) : EnableTelemetry(E) {}
+
+  // Telemetry can only be enabled if both the runtime and buildtime flag
+  // are set.
+  Config(bool E) : EnableTelemetry(E && BuildTimeEnableTelemetry) {}
----------------
labath wrote:

Just a drive-by

```suggestion
  explicit Config(bool E) : EnableTelemetry(E && BuildTimeEnableTelemetry) {}
```

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


More information about the lldb-commits mailing list