[Lldb-commits] [lldb] [llvm] [lldb]Implement LLDB Telemetry (PR #98528)

Vy Nguyen via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 24 09:14:46 PDT 2024


================
@@ -682,17 +683,51 @@ PacketStatus DAP::GetNextObject(llvm::json::Object &object) {
 }
 
 bool DAP::HandleObject(const llvm::json::Object &object) {
+  auto start_time = std::chrono::steady_clock::now();
   const auto packet_type = GetString(object, "type");
   if (packet_type == "request") {
     const auto command = GetString(object, "command");
     auto handler_pos = request_handlers.find(std::string(command));
+    lldb::SBStructuredData telemetry_entry;
+
+    // There does not seem to be a direct way to construct an SBStructuredData.
+    // So we first create a json::Array object,
+    // then we serialize it to a string,
+    // and finally call SBStructuredData::SetFromJSON(string).
+    //
+    // TODO: This seems unnecessarily complex. Ideally, we should be able to
----------------
oontvoo wrote:

Thanks - i'll resolve this for now. we can revisit this later

https://github.com/llvm/llvm-project/pull/98528


More information about the lldb-commits mailing list