Skip to content

Commit 22d15d4

Browse files
committed
renaming for clarity
1 parent 4e9d65e commit 22d15d4

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

lldb/include/lldb/Core/Telemetry.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ template <typename Info> struct ScopedDispatcher {
189189
}
190190

191191
void DispatchNow(llvm::unique_function<void(Info *info)> populate_fields_cb) {
192-
TelemetryManager *manager = TelemetryManager::GetInstanceIfEnabled();
193-
if (!manager)
192+
TelemetryManager *manager = TelemetryManager::GetInstance();
193+
if (!manager->GetConfig()->EnableTelemetry)
194194
return;
195195
Info info;
196196
// Populate the common fields we know aboutl
@@ -204,7 +204,6 @@ template <typename Info> struct ScopedDispatcher {
204204
LLDB_LOG_ERROR(GetLog(LLDBLog::Object), std::move(er),
205205
"Failed to dispatch entry of type: {0}", m_info.getKind());
206206
}
207-
208207
}
209208

210209
~ScopedDispatcher() {

lldb/source/Core/Telemetry.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ void CommandInfo::serialize(Serializer &serializer) const {
6565
serializer.write("target_uuid", target_uuid);
6666
serializer.write("command_id", command_id);
6767
serializer.write("command_name", command_name);
68+
serializer.write("original_command", original_command);
69+
serializer.write("args", args);
6870
serializer.write("ret_status", ret_status);
6971
serializer.write("error_data", error_data);
7072
}

lldb/source/Interpreter/CommandInterpreter.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,7 +1887,8 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
18871887
bool force_repeat_command) {
18881888
lldb_private::telemetry::ScopedDispatcher<
18891889
lldb_private::telemetry:CommandInfo> helper(m_debugger);
1890-
lldb_private::telemetry::TelemetryManager *ins = lldb_private::telemetry::TelemetryManager::GetInstance();
1890+
lldb_private::telemetry::TelemetryManager *ins =
1891+
lldb_private::telemetry::TelemetryManager::GetInstance();
18911892
const int command_id = ins->MakeNextCommandId();
18921893

18931894
std::string command_string(command_line);
@@ -1896,7 +1897,7 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
18961897
std::string parsed_command_args;
18971898
CommandObject *cmd_obj = nullptr;
18981899

1899-
helper.DispatchNow([&](lldb_private::telemetry:CommandInfo* info){
1900+
helper.DispatchNow([&](lldb_private::telemetry : CommandInfo *info) {
19001901
info.command_id = command_id;
19011902
if (Target* target = GetExecutionContext().GetTargetPtr()) {
19021903
// If we have a target attached to this command, then get the UUID.
@@ -1910,7 +1911,7 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
19101911
// Those will be collected by the on-exit-callback.
19111912
});
19121913

1913-
helper.DispatchOnExit([&](lldb_private::telemetry:CommandInfo* info) {
1914+
helper.DispatchOnExit([&](lldb_private::telemetry : CommandInfo *info) {
19141915
// TODO: this is logging the time the command-handler finishes.
19151916
// But we may want a finer-grain durations too?
19161917
// (ie., the execute_time recorded below?)

0 commit comments

Comments
 (0)