[Lldb-commits] [lldb] Add download time for each module in statistics (PR #134563)

via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 7 04:58:59 PDT 2025


================
@@ -188,17 +188,27 @@ GetFileForModule(const ModuleSpec &module_spec,
   std::string cache_file_name = llvm::toHex(build_id, true);
   if (!file_name.empty())
     cache_file_name += "-" + file_name.str();
-  llvm::Expected<std::string> result = llvm::getCachedOrDownloadArtifact(
-      cache_file_name, url_path, cache_path, debuginfod_urls, timeout);
-  if (result)
-    return FileSpec(*result);
-
-  Log *log = GetLog(LLDBLog::Symbols);
-  auto err_message = llvm::toString(result.takeError());
-  LLDB_LOGV(log,
-            "Debuginfod failed to download symbol artifact {0} with error {1}",
-            url_path, err_message);
-  return {};
+  StatsDuration duration;
+  ElapsedTime elapased(duration);
+  std::string local_path;
+  {
+    ElapsedTime elapsed(duration);
+    llvm::Expected<std::string> result = llvm::getCachedOrDownloadArtifact(
+        cache_file_name, url_path, cache_path, debuginfod_urls, timeout);
----------------
youngd007 wrote:

Not knowing the exact API of StatsDuration & ElapsedTime, is this getting the correct value for duration?  Why are we getting it once at start and then before the getCachedOrDownload?  Shouldn't the second time be _after_ the download?

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


More information about the lldb-commits mailing list