Skip to content

Commit 32d949b

Browse files
committed
use UUID for target_uuid
1 parent 267345a commit 32d949b

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

lldb/include/lldb/Core/Telemetry.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,16 @@ struct ExitDescription {
8484
struct TargetInfo : public LLDBBaseTelemetryInfo {
8585
lldb::ModuleSP exec_mod;
8686

87-
// The same as the executable-module's UUID.
88-
std::string target_uuid;
87+
/// The same as the executable-module's UUID.
88+
UUID target_uuid;
8989
std::string arch_name;
9090

91-
// If true, this entry was emitted at the beginning of an event (eg., before
92-
// the executable laod). Otherwise, it was emitted at the end of an event
93-
// (eg., after the module and any dependency were loaded.)
91+
/// If true, this entry was emitted at the beginning of an event (eg., before
92+
/// the executable is loaded). Otherwise, it was emitted at the end of an
93+
/// event (eg., after the module and any dependency were loaded.)
9494
bool is_start_entry;
9595

96-
// Describes the exit of the executable module.
96+
/// Describes the exit of the executable module.
9797
std::optional<ExitDescription> exit_desc;
9898
TargetInfo() = default;
9999

lldb/source/Core/Telemetry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void DebuggerInfo::serialize(Serializer &serializer) const {
7171
void TargetInfo::serialize(Serializer &serializer) const {
7272
LLDBBaseTelemetryInfo::serialize(serializer);
7373

74-
serializer.write("target_uuid", target_uuid);
74+
serializer.write("target_uuid", target_uuid.GetAsString());
7575
serializer.write("arch_name", arch_name);
7676
serializer.write("is_start_entry", is_start_entry);
7777
if (exit_desc.has_value()) {

lldb/source/Target/Process.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,8 +1068,7 @@ bool Process::SetExitStatus(int status, llvm::StringRef exit_string) {
10681068
Debugger *debugger = &(GetTarget().GetDebugger());
10691069
telemetry::ScopedDispatcher<telemetry::TargetInfo> helper(debugger);
10701070
// Save the Module UUID since the Module might be gone by end of scope.
1071-
std::string target_uuid =
1072-
GetTarget().GetExecutableModule()->GetUUID().GetAsString();
1071+
UUID target_uuid = GetTarget().GetExecutableModule()->GetUUID();
10731072

10741073
helper.DispatchNow([&](telemetry::TargetInfo *info) {
10751074
info->target_uuid = target_uuid;

lldb/source/Target/Target.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,14 +1567,14 @@ void Target::SetExecutableModule(ModuleSP &executable_sp,
15671567
if (executable_sp) {
15681568
helper.DispatchNow([&](telemetry::TargetInfo *info) {
15691569
info->exec_mod = executable_sp;
1570-
info->target_uuid = executable_sp->GetUUID().GetAsString();
1570+
info->target_uuid = executable_sp->GetUUID();
15711571
info->arch_name = executable_sp->GetArchitecture().GetArchitectureName();
15721572
info->is_start_entry = true;
15731573
});
15741574

15751575
helper.DispatchOnExit([&](telemetry::TargetInfo *info) {
15761576
info->exec_mod = executable_sp;
1577-
info->target_uuid = executable_sp->GetUUID().GetAsString();
1577+
info->target_uuid = executable_sp->GetUUID();
15781578
});
15791579

15801580
ElapsedTime elapsed(m_stats.GetCreateTime());

0 commit comments

Comments
 (0)