[Lldb-commits] [lldb] [LLDB][Telemetry]Define DebuggerTelemetryInfo and related methods (PR #127696)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Fri Feb 28 03:54:05 PST 2025
================
@@ -73,9 +100,50 @@ class TelemetryManager : public llvm::telemetry::Manager {
private:
std::unique_ptr<llvm::telemetry::Config> m_config;
+ // Each instance of a TelemetryManager is assigned a unique ID.
+ const std::string m_id;
+
static std::unique_ptr<TelemetryManager> g_instance;
};
+/// Helper RAII class for collecting telemetry.
+template <typename Info> struct ScopedDispatcher {
+ // The debugger pointer is optional because we may not have a debugger yet.
+ // In that case, caller must set the debugger later.
+ ScopedDispatcher(std::function<void(Info *info)> callback,
----------------
labath wrote:
```suggestion
ScopedDispatcher(llvm::unique_function<void(Info *info)> callback,
```
https://github.com/llvm/llvm-project/pull/127696
More information about the lldb-commits
mailing list