aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SBDebugger.cpp
diff options
context:
space:
mode:
authorVy Nguyen <vyng@google.com>2025-04-25 20:19:29 -0400
committerGitHub <noreply@github.com>2025-04-26 02:19:29 +0200
commita74e4ac9d52029f9c9fe80654acd9fdd34d2a4cd (patch)
tree17d97e2e0d518851cda2b54f5b519370f18ebbc4 /lldb/source/API/SBDebugger.cpp
parentcfc5baf6e6fc083fdbb584534a3fb8ea289752d2 (diff)
downloadllvm-a74e4ac9d52029f9c9fe80654acd9fdd34d2a4cd.zip
llvm-a74e4ac9d52029f9c9fe80654acd9fdd34d2a4cd.tar.gz
llvm-a74e4ac9d52029f9c9fe80654acd9fdd34d2a4cd.tar.bz2
[LLDB][Telemetry] Collect telemetry from client when allowed. (#129728)
This patch is slightly different from other impl in that we dispatch client-telemetry via a different helper method. This is to make it easier for vendor to opt-out (simply by overriding the method to do nothing). There is also a configuration option to disallow collecting client telemetry. --------- Co-authored-by: Pavel Labath <pavel@labath.sk>
Diffstat (limited to 'lldb/source/API/SBDebugger.cpp')
-rw-r--r--lldb/source/API/SBDebugger.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index 2cfcdc7..603e306 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -926,6 +926,17 @@ SBTarget SBDebugger::GetDummyTarget() {
return sb_target;
}
+void SBDebugger::DispatchClientTelemetry(const lldb::SBStructuredData &entry) {
+ LLDB_INSTRUMENT_VA(this);
+ if (m_opaque_sp) {
+ m_opaque_sp->DispatchClientTelemetry(*entry.m_impl_up);
+ } else {
+ Log *log = GetLog(LLDBLog::API);
+ LLDB_LOGF(log,
+ "Could not send telemetry from SBDebugger - debugger was null.");
+ }
+}
+
bool SBDebugger::DeleteTarget(lldb::SBTarget &target) {
LLDB_INSTRUMENT_VA(this, target);