Skip to content

Commit 5e99cc7

Browse files
committed
addressed review comments
1 parent f7be9c9 commit 5e99cc7

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

lldb/include/lldb/Core/Telemetry.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ struct CommandInfo : public LLDBBaseTelemetryInfo {
9898
/// session. Necessary because we'd send off an entry right before a command's
9999
/// execution and another right after. This is to avoid losing telemetry if
100100
/// the command does not execute successfully.
101-
uint64_t command_id;
101+
uint64_t command_id = 0;
102102
/// The command name(eg., "breakpoint set")
103103
std::string command_name;
104104
/// These two fields are not collected by default due to PII risks.
@@ -125,7 +125,7 @@ struct CommandInfo : public LLDBBaseTelemetryInfo {
125125

126126
void serialize(llvm::telemetry::Serializer &serializer) const override;
127127

128-
static uint64_t GetNextId();
128+
static uint64_t GetNextID();
129129

130130
private:
131131
// We assign each command (in the same session) a unique id so that their
@@ -161,14 +161,14 @@ struct ExecModuleInfo : public LLDBBaseTelemetryInfo {
161161
/// The same as the executable-module's UUID.
162162
UUID exec_uuid;
163163
/// PID of the process owned by this target.
164-
lldb::pid_t pid;
164+
lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
165165
/// The triple of this executable module.
166166
std::string triple;
167167

168168
/// If true, this entry was emitted at the beginning of an event (eg., before
169169
/// the executable is set). Otherwise, it was emitted at the end of an
170170
/// event (eg., after the module and any dependency were loaded.)
171-
bool is_start_entry;
171+
bool is_start_entry = false;
172172

173173
ExecModuleInfo() = default;
174174

@@ -192,8 +192,8 @@ struct ExitDescription {
192192

193193
struct ProcessExitInfo : public LLDBBaseTelemetryInfo {
194194
UUID exec_uuid;
195-
lldb::pid_t pid;
196-
bool is_start_entry;
195+
lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
196+
bool is_start_entry = false;
197197
std::optional<ExitDescription> exit_desc;
198198

199199
llvm::telemetry::KindType getKind() const override {

lldb/source/Core/Telemetry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ void CommandInfo::serialize(Serializer &serializer) const {
7676
serializer.write("error_data", error_data.value());
7777
}
7878

79-
std::atomic<uint64_t> CommandInfo::g_command_id_seed = 0;
80-
uint64_t CommandInfo::GetNextId() { return g_command_id_seed.fetch_add(1); }
79+
std::atomic<uint64_t> CommandInfo::g_command_id_seed = 1;
80+
uint64_t CommandInfo::GetNextID() { return g_command_id_seed.fetch_add(1); }
8181

8282
void DebuggerInfo::serialize(Serializer &serializer) const {
8383
LLDBBaseTelemetryInfo::serialize(serializer);

lldb/source/Interpreter/CommandInterpreter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,7 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
18911891
telemetry::TelemetryManager::GetInstance()
18921892
->GetConfig()
18931893
->detailed_command_telemetry;
1894-
const int command_id = telemetry::CommandInfo::GetNextId();
1894+
const int command_id = telemetry::CommandInfo::GetNextID();
18951895

18961896
std::string command_string(command_line);
18971897
std::string original_command_string(command_string);

lldb/source/Target/Target.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,7 @@ void Target::SetExecutableModule(ModuleSP &executable_sp,
15651565
ClearModules(false);
15661566

15671567
if (executable_sp) {
1568-
lldb::pid_t pid;
1568+
lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
15691569
if (ProcessSP proc = GetProcessSP())
15701570
pid = proc->GetID();
15711571

0 commit comments

Comments
 (0)