23
23
#include < atomic>
24
24
#include < chrono>
25
25
#include < ctime>
26
- #include < functional>
27
26
#include < memory>
28
27
#include < optional>
29
28
#include < string>
30
- #include < type_traits>
31
- #include < utility>
32
29
33
30
namespace lldb_private {
34
31
namespace telemetry {
@@ -49,18 +46,12 @@ struct LLDBConfig : public ::llvm::telemetry::Config {
49
46
// Specifically:
50
47
// - Length: 8 bits
51
48
// - First two bits (MSB) must be 11 - the common prefix
52
- // - Last two bits (LSB) are reserved for grand-children of LLDBTelemetryInfo
53
49
// If any of the subclass has descendents, those descendents
54
- // must have their LLDBEntryKind in the similar form (ie., share common prefix
55
- // and differ by the last two bits)
50
+ // must have their LLDBEntryKind in the similar form (ie., share common prefix)
56
51
struct LLDBEntryKind : public ::llvm::telemetry::EntryKind {
57
- // clang-format off
58
- static const llvm::telemetry::KindType BaseInfo = 0b11000000 ;
59
- static const llvm::telemetry::KindType CommandInfo = 0b11010000 ;
60
- static const llvm::telemetry::KindType DebuggerInfo = 0b11001000 ;
61
- static const llvm::telemetry::KindType ExecModuleInfo = 0b11000100 ;
62
- static const llvm::telemetry::KindType ProcessExitInfo = 0b11001100 ;
63
- // clang-format on
52
+ static const llvm::telemetry::KindType BaseInfo = 0b11000000 ;
53
+ static const llvm::telemetry::KindType CommandInfo = 0b11010000 ;
54
+ static const llvm::telemetry::KindType DebuggerInfo = 0b11000100 ;
64
55
};
65
56
66
57
// / Defines a convenient type for timestamp of various events.
@@ -98,7 +89,7 @@ struct CommandInfo : public LLDBBaseTelemetryInfo {
98
89
// / session. Necessary because we'd send off an entry right before a command's
99
90
// / execution and another right after. This is to avoid losing telemetry if
100
91
// / the command does not execute successfully.
101
- uint64_t command_id = 0 ;
92
+ uint64_t command_id;
102
93
// / The command name(eg., "breakpoint set")
103
94
std::string command_name;
104
95
// / These two fields are not collected by default due to PII risks.
@@ -125,7 +116,7 @@ struct CommandInfo : public LLDBBaseTelemetryInfo {
125
116
126
117
void serialize (llvm::telemetry::Serializer &serializer) const override ;
127
118
128
- static uint64_t GetNextID ();
119
+ static uint64_t GetNextId ();
129
120
130
121
private:
131
122
// We assign each command (in the same session) a unique id so that their
@@ -155,59 +146,6 @@ struct DebuggerInfo : public LLDBBaseTelemetryInfo {
155
146
void serialize (llvm::telemetry::Serializer &serializer) const override ;
156
147
};
157
148
158
- struct ExecutableModuleInfo : public LLDBBaseTelemetryInfo {
159
- lldb::ModuleSP exec_mod;
160
- // / The same as the executable-module's UUID.
161
- UUID uuid;
162
- // / PID of the process owned by this target.
163
- lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
164
- // / The triple of this executable module.
165
- std::string triple;
166
-
167
- // / If true, this entry was emitted at the beginning of an event (eg., before
168
- // / the executable is set). Otherwise, it was emitted at the end of an
169
- // / event (eg., after the module and any dependency were loaded.)
170
- bool is_start_entry = false ;
171
-
172
- ExecutableModuleInfo () = default ;
173
-
174
- llvm::telemetry::KindType getKind () const override {
175
- return LLDBEntryKind::ExecModuleInfo;
176
- }
177
-
178
- static bool classof (const TelemetryInfo *T) {
179
- // Subclasses of this is also acceptable
180
- return (T->getKind () & LLDBEntryKind::ExecModuleInfo) ==
181
- LLDBEntryKind::ExecModuleInfo;
182
- }
183
- void serialize (llvm::telemetry::Serializer &serializer) const override ;
184
- };
185
-
186
- // / Describes an exit status.
187
- struct ExitDescription {
188
- int exit_code;
189
- std::string description;
190
- };
191
-
192
- struct ProcessExitInfo : public LLDBBaseTelemetryInfo {
193
- // The executable-module's UUID.
194
- UUID module_uuid;
195
- lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
196
- bool is_start_entry = false ;
197
- std::optional<ExitDescription> exit_desc;
198
-
199
- llvm::telemetry::KindType getKind () const override {
200
- return LLDBEntryKind::ProcessExitInfo;
201
- }
202
-
203
- static bool classof (const TelemetryInfo *T) {
204
- // Subclasses of this is also acceptable
205
- return (T->getKind () & LLDBEntryKind::ProcessExitInfo) ==
206
- LLDBEntryKind::ProcessExitInfo;
207
- }
208
- void serialize (llvm::telemetry::Serializer &serializer) const override ;
209
- };
210
-
211
149
// / The base Telemetry manager instance in LLDB.
212
150
// / This class declares additional instrumentation points
213
151
// / applicable to LLDB.
0 commit comments