[Lldb-commits] [lldb] [LLDB][Telemetry]Define TargetInfo for collecting data about a target (PR #127834)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Tue Mar 18 10:20:36 PDT 2025
================
@@ -146,6 +155,59 @@ struct DebuggerInfo : public LLDBBaseTelemetryInfo {
void serialize(llvm::telemetry::Serializer &serializer) const override;
};
+struct ExecModuleInfo : public LLDBBaseTelemetryInfo {
+ lldb::ModuleSP exec_mod;
+
+ /// The same as the executable-module's UUID.
+ UUID exec_uuid;
+ /// PID of the process owned by this target.
+ lldb::pid_t pid;
+ /// The triple of this executable module.
+ std::string triple;
+
+ /// If true, this entry was emitted at the beginning of an event (eg., before
+ /// the executable is set). Otherwise, it was emitted at the end of an
+ /// event (eg., after the module and any dependency were loaded.)
+ bool is_start_entry;
+
+ ExecModuleInfo() = default;
+
+ llvm::telemetry::KindType getKind() const override {
+ return LLDBEntryKind::ExecModuleInfo;
+ }
+
+ static bool classof(const TelemetryInfo *T) {
+ // Subclasses of this is also acceptable
+ return (T->getKind() & LLDBEntryKind::ExecModuleInfo) ==
+ LLDBEntryKind::ExecModuleInfo;
+ }
+ void serialize(llvm::telemetry::Serializer &serializer) const override;
+};
+
+/// Describes an exit status.
+struct ExitDescription {
+ int exit_code;
+ std::string description;
+};
+
+struct ProcessExitInfo : public LLDBBaseTelemetryInfo {
+ UUID exec_uuid;
+ lldb::pid_t pid;
+ bool is_start_entry;
+ std::optional<ExitDescription> exit_desc;
+
+ llvm::telemetry::KindType getKind() const override {
+ return LLDBEntryKind::ProcessExitInfo;
+ }
+
+ static bool classof(const TelemetryInfo *T) {
+ // Subclasses of this is also acceptable
----------------
JDevlieghere wrote:
```suggestion
// Subclasses of this is also acceptable.
```
https://github.com/llvm/llvm-project/pull/127834
More information about the lldb-commits
mailing list