Skip to content

[LLDB][Telemetry] Collect telemetry from client when allowed. #129728

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

Merged
merged 30 commits into from
Apr 26, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
21103ad
[LLDB][Telemetry] Collect telemetry from client when allowed.
oontvoo Mar 4, 2025
c0cf1c0
formatting
oontvoo Mar 4, 2025
4b13494
Merge branch 'main' into client
oontvoo Mar 18, 2025
11fd330
reconcile with new api change
oontvoo Mar 19, 2025
1aff2b1
Merge branch 'main' into client
oontvoo Mar 24, 2025
4718da4
formatting
oontvoo Mar 24, 2025
8b15611
Update SBDebugger.h
oontvoo Mar 24, 2025
a5a8ac7
Update lldb/source/API/SBDebugger.cpp
oontvoo Mar 25, 2025
4990441
Update lldb/source/Core/Telemetry.cpp
oontvoo Mar 25, 2025
63b80b2
Update lldb/source/Core/Telemetry.cpp
oontvoo Mar 25, 2025
56a2018
Update lldb/unittests/Core/TelemetryTest.cpp
oontvoo Mar 25, 2025
a31d160
address review comments
oontvoo Mar 25, 2025
60eb43a
rename
oontvoo Mar 25, 2025
f6f3852
rename again
oontvoo Mar 25, 2025
2d2d63d
update Telemetry
oontvoo Mar 25, 2025
eb4b0f1
update
oontvoo Mar 25, 2025
b875599
add client_name field
oontvoo Mar 26, 2025
c35e38e
disable client telemetry for SWIG
oontvoo Mar 26, 2025
31a0ed2
formatting
oontvoo Mar 26, 2025
ef5257e
Update SBDebugger.h
oontvoo Mar 26, 2025
fa90be0
Merge branch 'main' into client
oontvoo Mar 27, 2025
60de76d
formatting
oontvoo Mar 27, 2025
654f8ca
use GetClientName
oontvoo Mar 27, 2025
1c56b80
define macro to disable client-telemetry
oontvoo Mar 28, 2025
4c161d8
typo
oontvoo Mar 28, 2025
b408b88
update
oontvoo Mar 28, 2025
ce679cd
Merge branch 'main' into client
oontvoo Apr 24, 2025
af0504c
put condition behind ifndef SWIG
oontvoo Apr 24, 2025
253291f
remove unnecessary ifdef branch
oontvoo Apr 25, 2025
0a5da4a
Merge branch 'main' into client
oontvoo Apr 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add client_name field
  • Loading branch information
oontvoo committed Mar 26, 2025
commit b875599c75d05d5e147fe23ce366dd95522c9cd6
1 change: 1 addition & 0 deletions lldb/include/lldb/Core/Telemetry.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ struct LLDBBaseTelemetryInfo : public llvm::telemetry::TelemetryInfo {
};

struct ClientInfo : public LLDBBaseTelemetryInfo {
std::string client_name;
std::string client_data;
std::optional<std::string> error_msg;

Expand Down
8 changes: 8 additions & 0 deletions lldb/source/Core/Telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ void LLDBBaseTelemetryInfo::serialize(Serializer &serializer) const {
void ClientInfo::serialize(Serializer &serializer) const {
LLDBBaseTelemetryInfo::serialize(serializer);
serializer.write("client_data", client_data);
serializer.write("client_name", client_name);
if (error_msg.has_value())
serializer.write("error_msg", error_msg.value());
}
Expand Down Expand Up @@ -141,6 +142,13 @@ void TelemetryManager::DispatchClientTelemetry(

auto *dict = entry.GetObjectSP()->GetAsDictionary();

llvm::StringRef client_name;
if (dict->GetValueForKeyAsString("client_name", client_name))
client_info.client_name = client_name.str();
else
LLDB_LOG(GetLog(LLDBLog::Object),
"Cannot determine client_name from client-telemetry entry");

llvm::StringRef client_data;
if (dict->GetValueForKeyAsString("client_data", client_data))
client_info.client_data = client_data.str();
Expand Down
1 change: 1 addition & 0 deletions lldb/tools/lldb-dap/DAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ void DAP::SetTarget(const lldb::SBTarget target) {

bool DAP::HandleObject(const protocol::Message &M) {
TelemetryDispatcher dispatcher(&debugger);
dispatcher.Set("client_name", "DAP");
if (const auto *req = std::get_if<protocol::Request>(&M)) {
auto handler_pos = request_handlers.find(req->command);
dispatcher.Set("client_data",
Expand Down
Loading