[Lldb-commits] [lldb] 799e905 - [lldb] Create a default rate limit constant in Progress (NFC) (#133506)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Mar 31 08:29:24 PDT 2025
Author: Jonas Devlieghere
Date: 2025-03-31T08:29:20-07:00
New Revision: 799e9053641a6478d3144866a97737b37b87c260
URL: https://github.com/llvm/llvm-project/commit/799e9053641a6478d3144866a97737b37b87c260
DIFF: https://github.com/llvm/llvm-project/commit/799e9053641a6478d3144866a97737b37b87c260.diff
LOG: [lldb] Create a default rate limit constant in Progress (NFC) (#133506)
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.
Although it'd be possible to hook up, given how few progress events
currently implement rate limiting, I don't think it's worth threading
this through, if that's even possible.
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.
Added:
Modified:
lldb/include/lldb/Core/Progress.h
lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Core/Progress.h b/lldb/include/lldb/Core/Progress.h
index 3003568e8946b..93e34084d7ec1 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 report time for high frequency progress reports.
+ static constexpr std::chrono::milliseconds kDefaultHighFrequencyReportTime =
+ 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..047967a30d098 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::kDefaultHighFrequencyReportTime);
// 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..ce351274b4576 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -724,7 +724,7 @@ void SymbolFileDWARFDebugMap::ForEachSymbolFile(
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));
+ Progress::kDefaultHighFrequencyReportTime);
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()
More information about the lldb-commits
mailing list