Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 90f077c

Browse filesBrowse files
authored
[lldb] Emit signpost intervals for progress events (NFC) (llvm#108498)
Emit signpost intervals for progress events so that when users report an operation takes a long time, we can investigate the issue with Instruments.app.
1 parent 1b4aea6 commit 90f077c
Copy full SHA for 90f077c

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed

‎lldb/source/Core/Progress.cpp

Copy file name to clipboardExpand all lines: lldb/source/Core/Progress.cpp
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "lldb/Core/Debugger.h"
1212
#include "lldb/Utility/StreamString.h"
13+
#include "llvm/Support/Signposts.h"
1314

1415
#include <cstdint>
1516
#include <mutex>
@@ -20,6 +21,9 @@ using namespace lldb_private;
2021

2122
std::atomic<uint64_t> Progress::g_id(0);
2223

24+
// Instrument progress events with signposts when supported.
25+
static llvm::ManagedStatic<llvm::SignpostEmitter> g_progress_signposts;
26+
2327
Progress::Progress(std::string title, std::string details,
2428
std::optional<uint64_t> total,
2529
lldb_private::Debugger *debugger)
@@ -39,9 +43,15 @@ Progress::Progress(std::string title, std::string details,
3943
// Report to the ProgressManager if that subsystem is enabled.
4044
if (ProgressManager::Enabled())
4145
ProgressManager::Instance().Increment(m_progress_data);
46+
47+
// Start signpost interval right before the meaningful work starts.
48+
g_progress_signposts->startInterval(this, m_progress_data.title);
4249
}
4350

4451
Progress::~Progress() {
52+
// End signpost interval as soon as possible.
53+
g_progress_signposts->endInterval(this, m_progress_data.title);
54+
4555
// Make sure to always report progress completed when this object is
4656
// destructed so it indicates the progress dialog/activity should go away.
4757
std::lock_guard<std::mutex> guard(m_mutex);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.