@@ -55,10 +55,11 @@ struct LLDBConfig : public ::llvm::telemetry::Config {
5555// and differ by the last two bits)
5656struct LLDBEntryKind : public ::llvm::telemetry::EntryKind {
5757 // 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 TargetInfo = 0b11000100 ;
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 ;
6263 // clang-format on
6364};
6465
@@ -88,42 +89,6 @@ struct LLDBBaseTelemetryInfo : public llvm::telemetry::TelemetryInfo {
8889 void serialize (llvm::telemetry::Serializer &serializer) const override ;
8990};
9091
91- // / Describes an exit status.
92- struct ExitDescription {
93- int exit_code;
94- std::string description;
95- };
96-
97- struct TargetInfo : public LLDBBaseTelemetryInfo {
98- lldb::ModuleSP exec_mod;
99-
100- // / The same as the executable-module's UUID.
101- UUID target_uuid;
102- // / PID of the process owned by this target.
103- lldb::pid_t pid;
104- std::string arch_name;
105-
106- // / If true, this entry was emitted at the beginning of an event (eg., before
107- // / the executable is loaded). Otherwise, it was emitted at the end of an
108- // / event (eg., after the module and any dependency were loaded.)
109- bool is_start_entry;
110-
111- // / Describes the exit of the executable module.
112- std::optional<ExitDescription> exit_desc;
113- TargetInfo () = default ;
114-
115- llvm::telemetry::KindType getKind () const override {
116- return LLDBEntryKind::TargetInfo;
117- }
118-
119- static bool classof (const TelemetryInfo *T) {
120- // Subclasses of this is also acceptable
121- return (T->getKind () & LLDBEntryKind::TargetInfo) ==
122- LLDBEntryKind::TargetInfo;
123- }
124- void serialize (llvm::telemetry::Serializer &serializer) const override ;
125- };
126-
12792struct CommandInfo : public LLDBBaseTelemetryInfo {
12893 // / If the command is/can be associated with a target entry this field
12994 // / contains that target's UUID. <EMPTY> otherwise.
@@ -190,6 +155,58 @@ struct DebuggerInfo : public LLDBBaseTelemetryInfo {
190155 void serialize (llvm::telemetry::Serializer &serializer) const override ;
191156};
192157
158+ struct ExecModuleInfo : public LLDBBaseTelemetryInfo {
159+ lldb::ModuleSP exec_mod;
160+
161+ // / The same as the executable-module's UUID.
162+ UUID exec_uuid;
163+ // / PID of the process owned by this target.
164+ lldb::pid_t pid;
165+ std::string arch_name;
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;
171+
172+ ExecModuleInfo () = 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+ UUID exec_uuid;
194+ lldb::pid_t pid;
195+ bool is_start_entry;
196+ std::optional<ExitDescription> exit_desc;
197+
198+ llvm::telemetry::KindType getKind () const override {
199+ return LLDBEntryKind::ProcessExitInfo;
200+ }
201+
202+ static bool classof (const TelemetryInfo *T) {
203+ // Subclasses of this is also acceptable
204+ return (T->getKind () & LLDBEntryKind::ProcessExitInfo) ==
205+ LLDBEntryKind::ProcessExitInfo;
206+ }
207+ void serialize (llvm::telemetry::Serializer &serializer) const override ;
208+ };
209+
193210// / The base Telemetry manager instance in LLDB.
194211// / This class declares additional instrumentation points
195212// / applicable to LLDB.
0 commit comments