1313#include " lldb/Interpreter/CommandReturnObject.h"
1414#include " lldb/Utility/LLDBLog.h"
1515#include " lldb/Utility/StructuredData.h"
16- #include " lldb/Utility/LLDBLog.h"
1716#include " lldb/lldb-forward.h"
1817#include " llvm/ADT/FunctionExtras.h"
1918#include " llvm/ADT/StringExtras.h"
2019#include " llvm/ADT/StringRef.h"
21- #include " llvm/ADT/FunctionExtras.h"
2220#include " llvm/Support/JSON.h"
2321#include " llvm/Telemetry/Telemetry.h"
2422#include < atomic>
3129namespace lldb_private {
3230namespace telemetry {
3331
34-
3532struct LLDBConfig : public ::llvm::telemetry::Config {
36- // If true, we will collect full details about a debug command (eg., args and original command).
37- // Note: This may contain PII, hence can only be enabled by the vendor while creating the Manager.
33+ // If true, we will collect full details about a debug command (eg., args and
34+ // original command). Note: This may contain PII, hence can only be enabled by
35+ // the vendor while creating the Manager.
3836 const bool m_detailed_command_telemetry;
3937
4038 explicit LLDBConfig (bool enable_telemetry, bool detailed_command_telemetry)
41- : ::llvm::telemetry::Config(enable_telemetry), m_detailed_command_telemetry(detailed_command_telemetry) {}
39+ : ::llvm::telemetry::Config(enable_telemetry),
40+ m_detailed_command_telemetry(detailed_command_telemetry) {}
4241};
4342
4443// We expect each (direct) subclass of LLDBTelemetryInfo to
@@ -94,7 +93,8 @@ struct CommandInfo : public LLDBBaseTelemetryInfo {
9493 // Eg., "breakpoint set"
9594 std::string command_name;
9695 // !!NOTE!! These two fields are not collected by default due to PII risks.
97- // Vendor may allow them by setting the LLDBConfig::m_detailed_command_telemetry.
96+ // Vendor may allow them by setting the
97+ // LLDBConfig::m_detailed_command_telemetry.
9898 std::string original_command;
9999 std::string args;
100100 // Return status of a command and any error description in case of error.
@@ -103,14 +103,17 @@ struct CommandInfo : public LLDBBaseTelemetryInfo {
103103
104104 CommandInfo () = default ;
105105
106- llvm::telemetry::KindType getKind () const override { return LLDBEntryKind::CommandInfo; }
106+ llvm::telemetry::KindType getKind () const override {
107+ return LLDBEntryKind::CommandInfo;
108+ }
107109
108110 static bool classof (const llvm::telemetry::TelemetryInfo *T) {
109- return (T->getKind () & LLDBEntryKind::CommandInfo) == LLDBEntryKind::CommandInfo;
111+ return (T->getKind () & LLDBEntryKind::CommandInfo) ==
112+ LLDBEntryKind::CommandInfo;
110113 }
111114
112115 void serialize (llvm::telemetry::Serializer &serializer) const override ;
113- };
116+ };
114117
115118struct DebuggerInfo : public LLDBBaseTelemetryInfo {
116119 std::string lldb_version;
@@ -142,7 +145,7 @@ class TelemetryManager : public llvm::telemetry::Manager {
142145 // / Returns the next unique ID to assign to a command entry.
143146 int MakeNextCommandId ();
144147
145- const LLDBConfig* GetConfig () { return m_config.get (); }
148+ const LLDBConfig * GetConfig () { return m_config.get (); }
146149
147150 virtual llvm::StringRef GetInstanceName () const = 0;
148151
@@ -155,7 +158,7 @@ class TelemetryManager : public llvm::telemetry::Manager {
155158
156159private:
157160 std::unique_ptr<LLDBConfig> m_config;
158- // Each instance of a TelemetryManager is assigned a unique ID.
161+ // Each instance of a TelemetryManager is assigned a unique ID.
159162 const std::string m_id;
160163 // We assign each command (in the same session) a unique id so that their
161164 // "start" and "end" entries can be matched up.
@@ -216,8 +219,7 @@ template <typename Info> struct ScopedDispatcher {
216219private:
217220 SteadyTimePoint m_start_time;
218221 llvm::unique_function<void (Info *info)> m_final_callback;
219- Debugger * debugger;
220-
222+ Debugger *debugger;
221223};
222224
223225} // namespace telemetry
0 commit comments