[Lldb-commits] [lldb] Add download time for each module in statistics (PR #134563)
via lldb-commits
lldb-commits at lists.llvm.org
Thu Apr 10 13:16:37 PDT 2025
================
@@ -188,17 +188,26 @@ 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;
+ std::string local_path;
+ {
+ ElapsedTime elapsed(duration);
+ llvm::Expected<std::string> result = llvm::getCachedOrDownloadArtifact(
+ cache_file_name, url_path, cache_path, debuginfod_urls, timeout);
+
+ if (!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 {};
+ }
+ local_path = *result;
+ }
+
+ return FileSpec(local_path, duration.get().count());
----------------
GeorgeHuyubo wrote:
Removed
https://github.com/llvm/llvm-project/pull/134563
More information about the lldb-commits
mailing list