-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[LLDB][Telemetry]Define TargetInfo for collecting data about a target #127834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
0d6a36d
19c6181
f152b3b
4f8555a
a5bd22e
bb22874
f49c3e2
3bd8897
d3cb8d8
267345a
32d949b
5c6c83c
39c39cc
1fdf120
1ed73e7
92e06fa
aab5002
31c63e0
20c8f59
9954083
55aa4ee
c8ca5b8
4783b57
ae73ebe
0a2505a
4d3d26e
b1b7a50
f7be9c9
41f0696
5e99cc7
a709ac3
220554a
1ecbe48
1231bc2
5757b41
a936e2e
142097a
d297813
885675e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |||||||||||||||||
| #include "lldb/Utility/LLDBLog.h" | ||||||||||||||||||
| #include "lldb/Utility/StructuredData.h" | ||||||||||||||||||
| #include "lldb/lldb-forward.h" | ||||||||||||||||||
| #include "llvm/ADT/DenseMap.h" | ||||||||||||||||||
| #include "llvm/ADT/FunctionExtras.h" | ||||||||||||||||||
| #include "llvm/ADT/StringExtras.h" | ||||||||||||||||||
| #include "llvm/ADT/StringRef.h" | ||||||||||||||||||
|
|
@@ -25,6 +26,11 @@ | |||||||||||||||||
| #include <optional> | ||||||||||||||||||
| #include <string> | ||||||||||||||||||
|
|
||||||||||||||||||
| #include <functional> | ||||||||||||||||||
| #include <type_traits> | ||||||||||||||||||
| #include <unordered_map> | ||||||||||||||||||
| #include <utility> | ||||||||||||||||||
|
|
||||||||||||||||||
| namespace lldb_private { | ||||||||||||||||||
| namespace telemetry { | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -33,11 +39,14 @@ namespace telemetry { | |||||||||||||||||
| // Specifically: | ||||||||||||||||||
| // - Length: 8 bits | ||||||||||||||||||
| // - First two bits (MSB) must be 11 - the common prefix | ||||||||||||||||||
| // - Last two bits (LSB) are reserved for grand-children of LLDBTelemetryInfo | ||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have to say I'm liking this bitfield system less and less every time I see it. |
||||||||||||||||||
| // If any of the subclass has descendents, those descendents | ||||||||||||||||||
| // must have their LLDBEntryKind in the similar form (ie., share common prefix) | ||||||||||||||||||
| // must have their LLDBEntryKind in the similar form (ie., share common prefix | ||||||||||||||||||
| // and differ by the last two bits) | ||||||||||||||||||
| struct LLDBEntryKind : public ::llvm::telemetry::EntryKind { | ||||||||||||||||||
| static const llvm::telemetry::KindType BaseInfo = 0b11000000; | ||||||||||||||||||
| static const llvm::telemetry::KindType DebuggerInfo = 0b11000100; | ||||||||||||||||||
| static const llvm::telemetry::KindType TargetInfo = 0b11001000; | ||||||||||||||||||
| }; | ||||||||||||||||||
|
|
||||||||||||||||||
| /// Defines a convenient type for timestamp of various events. | ||||||||||||||||||
|
|
@@ -66,6 +75,40 @@ struct LLDBBaseTelemetryInfo : public llvm::telemetry::TelemetryInfo { | |||||||||||||||||
| void serialize(llvm::telemetry::Serializer &serializer) const override; | ||||||||||||||||||
| }; | ||||||||||||||||||
|
|
||||||||||||||||||
| /// Describes an exit status. | ||||||||||||||||||
| struct ExitDescription { | ||||||||||||||||||
| int exit_code; | ||||||||||||||||||
| std::string description; | ||||||||||||||||||
| }; | ||||||||||||||||||
|
|
||||||||||||||||||
| struct TargetInfo : public LLDBBaseTelemetryInfo { | ||||||||||||||||||
| lldb::ModuleSP exec_mod; | ||||||||||||||||||
|
|
||||||||||||||||||
| // The same as the executable-module's UUID. | ||||||||||||||||||
|
||||||||||||||||||
| // The same as the executable-module's UUID. | |
| /// The same as the executable-module's UUID. |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| std::string target_uuid; | |
| std::string arch_name; | |
| UUID target_uuid; | |
| ArchSpec arch_name; |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // If true, this entry was emitted at the beginning of an event (eg., before | |
| // the executable laod). Otherwise, it was emitted at the end of an event | |
| // (eg., after the module and any dependency were loaded.) | |
| bool is_start_entry; | |
| /// If true, this entry was emitted at the beginning of an event (eg., before | |
| /// the executable laod). Otherwise, it was emitted at the end of an event | |
| /// (eg., after the module and any dependency were loaded.) | |
| bool is_start_entry; |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Describes the exit of the executable module. | |
| /// Describes the exit of the executable module. |
Uh oh!
There was an error while loading. Please reload this page.