Skip to content

Commit b1b7a50

Browse files
committed
addressed review comment
1 parent 4d3d26e commit b1b7a50

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

lldb/include/lldb/Core/Telemetry.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ struct ExecModuleInfo : public LLDBBaseTelemetryInfo {
162162
UUID exec_uuid;
163163
/// PID of the process owned by this target.
164164
lldb::pid_t pid;
165-
std::string arch_name;
165+
/// The triple of this executable module.
166+
std::string triple;
166167

167168
/// If true, this entry was emitted at the beginning of an event (eg., before
168169
/// the executable is set). Otherwise, it was emitted at the end of an

lldb/include/lldb/Target/Target.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,6 @@ class Target : public std::enable_shared_from_this<Target>,
544544
return GetStaticBroadcasterClass();
545545
}
546546

547-
UUID GetExecModuleUUID() const { return m_current_exec_mod_uuid; }
548-
549547
// This event data class is for use by the TargetList to broadcast new target
550548
// notifications.
551549
class TargetEventData : public EventData {
@@ -1642,8 +1640,6 @@ class Target : public std::enable_shared_from_this<Target>,
16421640
private:
16431641
// Target metrics storage.
16441642
TargetStats m_stats;
1645-
// The current executable module UUID.
1646-
UUID m_current_exec_mod_uuid;
16471643

16481644
public:
16491645
/// Get metrics associated with this target in JSON format.

lldb/source/Core/Telemetry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void ExecModuleInfo::serialize(Serializer &serializer) const {
9292

9393
serializer.write("exec_uuid", exec_uuid.GetAsString());
9494
serializer.write("pid", pid);
95-
serializer.write("arch_name", arch_name);
95+
serializer.write("triple", triple);
9696
serializer.write("is_start_entry", is_start_entry);
9797
}
9898

lldb/source/Target/Process.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,14 +1068,11 @@ bool Process::SetExitStatus(int status, llvm::StringRef exit_string) {
10681068
telemetry::ScopedDispatcher<telemetry::ProcessExitInfo> helper;
10691069

10701070
// Find the executable-module's UUID, if available.
1071+
Target &target = GetTarget();
1072+
helper.SetDebugger(&(target.GetDebugger()));
10711073
UUID exec_uuid;
1072-
// Check if there is (still) a valid target and get the debugger and exec_uuid
1073-
// from it.
1074-
TargetSP target_sp(Debugger::FindTargetWithProcessID(m_pid));
1075-
if (target_sp) {
1076-
helper.SetDebugger(&(target_sp->GetDebugger()));
1077-
exec_uuid = target_sp->GetExecModuleUUID();
1078-
}
1074+
if (ModuleSP exec_mod = target.GetExecutableModule())
1075+
exec_uuid = exec_mod->GetUUID();
10791076

10801077
helper.DispatchNow([&](telemetry::ProcessExitInfo *info) {
10811078
info->exec_uuid = exec_uuid;

lldb/source/Target/Target.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,15 +1565,15 @@ void Target::SetExecutableModule(ModuleSP &executable_sp,
15651565
ClearModules(false);
15661566

15671567
if (executable_sp) {
1568-
m_current_exec_mod_uuid = executable_sp->GetUUID();
15691568
lldb::pid_t pid;
15701569
if (ProcessSP proc = GetProcessSP())
15711570
pid = proc->GetID();
1571+
15721572
helper.DispatchNow([&](telemetry::ExecModuleInfo *info) {
15731573
info->exec_mod = executable_sp;
1574-
info->exec_uuid = m_current_exec_mod_uuid;
1574+
info->exec_uuid = executable_sp->GetUUID();
15751575
info->pid = pid;
1576-
info->arch_name = executable_sp->GetArchitecture().GetArchitectureName();
1576+
info->triple = executable_sp->GetArchitecture().GetTriple().getTriple();
15771577
info->is_start_entry = true;
15781578
});
15791579

0 commit comments

Comments
 (0)