llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-lldb Author: Jonas Devlieghere (JDevlieghere) <details> <summary>Changes</summary> In #<!-- -->133211, Greg suggested making the rate limit configurable through a setting. Although adding the setting is easy, the two places where we currently use rate limiting aren't tied to a particular debugger. I still think it's a good idea to be consistent and make it easy to pick the same rate limiting value, so I've moved it into a constant in the Progress class. --- Full diff: https://github.com/llvm/llvm-project/pull/133506.diff 3 Files Affected: - (modified) lldb/include/lldb/Core/Progress.h (+4) - (modified) lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp (+1-1) - (modified) lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (+1-2) ``````````diff diff --git a/lldb/include/lldb/Core/Progress.h b/lldb/include/lldb/Core/Progress.h index 3003568e8946b..104a8c0feb80a 100644 --- a/lldb/include/lldb/Core/Progress.h +++ b/lldb/include/lldb/Core/Progress.h @@ -115,6 +115,10 @@ class Progress { /// Used to indicate a non-deterministic progress report static constexpr uint64_t kNonDeterministicTotal = UINT64_MAX; + /// The default rate limit for high frequency progress reports. + static constexpr std::chrono::milliseconds kDefaultRateLimit = + std::chrono::milliseconds(20); + private: void ReportProgress(); static std::atomic<uint64_t> g_id; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp index 6f2c45e74132c..f6304a7a4b9ba 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp @@ -81,7 +81,7 @@ void ManualDWARFIndex::Index() { const uint64_t total_progress = units_to_index.size() * 2 + 8; Progress progress("Manually indexing DWARF", module_desc.GetData(), total_progress, /*debugger=*/nullptr, - /*minimum_report_time=*/std::chrono::milliseconds(20)); + Progress::kDefaultRateLimit); // Share one thread pool across operations to avoid the overhead of // recreating the threads. diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index e346d588a449f..8b72c96dc6f33 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -723,8 +723,7 @@ void SymbolFileDWARFDebugMap::ForEachSymbolFile( std::function<IterationAction(SymbolFileDWARF &)> closure) { const size_t num_oso_idxs = m_compile_unit_infos.size(); Progress progress(std::move(description), "", num_oso_idxs, - /*debugger=*/nullptr, - /*minimum_report_time=*/std::chrono::milliseconds(20)); + /*debugger=*/nullptr, Progress::kDefaultRateLimit); for (uint32_t oso_idx = 0; oso_idx < num_oso_idxs; ++oso_idx) { if (SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx)) { progress.Increment(oso_idx, oso_dwarf->GetObjectFile() `````````` </details> https://github.com/llvm/llvm-project/pull/133506 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits