Skip to content

[lldb] Create a default rate limit constant in Progress (NFC) #133506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lldb/include/lldb/Core/Progress.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading