LLDB mainline
|
A class used to group progress reports by category. More...
#include <Progress.h>
Classes | |
struct | Entry |
Entry used for bookkeeping. More... | |
Public Member Functions | |
ProgressManager () | |
~ProgressManager () | |
void | Increment (const Progress::ProgressData &) |
Control the refcount of the progress report category as needed. | |
void | Decrement (const Progress::ProgressData &) |
Static Public Member Functions | |
static void | Initialize () |
static void | Terminate () |
static bool | Enabled () |
static ProgressManager & | Instance () |
Protected Types | |
enum class | EventType { Begin , End } |
Protected Member Functions | |
void | Expire (llvm::StringRef key) |
Helper function for reporting progress when the alarm in the corresponding entry in the map expires. | |
Static Protected Member Functions | |
static void | ReportProgress (const Progress::ProgressData &progress_data, EventType type) |
static std::optional< ProgressManager > & | InstanceImpl () |
Protected Attributes | |
llvm::StringMap< Entry > | m_entries |
Map used for bookkeeping. | |
std::mutex | m_entries_mutex |
Mutex to provide the map. | |
Alarm | m_alarm |
Alarm instance to coalesce progress events. | |
A class used to group progress reports by category.
This is done by using a map that maintains a refcount of each category of progress reports that have come in. Keeping track of progress reports this way will be done if a debugger is listening to the eBroadcastBitProgressByCategory broadcast bit.
Definition at line 145 of file Progress.h.
|
strongprotected |
Enumerator | |
---|---|
Begin | |
End |
Definition at line 160 of file Progress.h.
ProgressManager::ProgressManager | ( | ) |
Definition at line 83 of file Progress.cpp.
ProgressManager::~ProgressManager | ( | ) |
Definition at line 86 of file Progress.cpp.
void ProgressManager::Decrement | ( | const Progress::ProgressData & | progress_data | ) |
Definition at line 140 of file Progress.cpp.
References lldb_private::Alarm::Create(), Expire(), lldb_private::ProgressManager::Entry::handle, lldb_private::Alarm::INVALID_HANDLE, m_alarm, m_entries, m_entries_mutex, lldb_private::ProgressManager::Entry::refcount, and lldb_private::Progress::ProgressData::title.
Referenced by lldb_private::Progress::~Progress().
|
static |
Definition at line 98 of file Progress.cpp.
References InstanceImpl().
Referenced by lldb_private::Progress::Progress(), and lldb_private::Progress::~Progress().
|
protected |
Helper function for reporting progress when the alarm in the corresponding entry in the map expires.
Definition at line 177 of file Progress.cpp.
References End, m_entries, m_entries_mutex, and ReportProgress().
Referenced by Decrement().
void ProgressManager::Increment | ( | const Progress::ProgressData & | progress_data | ) |
Control the refcount of the progress report category as needed.
Definition at line 110 of file Progress.cpp.
References Begin, lldb_private::Alarm::Cancel(), lldb_private::ProgressManager::Entry::data, lldb_private::ProgressManager::Entry::handle, lldb_private::Alarm::INVALID_HANDLE, m_alarm, m_entries, m_entries_mutex, lldb_private::ProgressManager::Entry::refcount, ReportProgress(), and lldb_private::Progress::ProgressData::title.
Referenced by lldb_private::Progress::Progress().
|
static |
Definition at line 88 of file Progress.cpp.
References InstanceImpl().
Referenced by lldb_private::SystemInitializerFull::Initialize().
|
static |
Definition at line 100 of file Progress.cpp.
References InstanceImpl().
Referenced by lldb_private::Progress::Progress(), and lldb_private::Progress::~Progress().
|
staticprotected |
Definition at line 105 of file Progress.cpp.
Referenced by Enabled(), Initialize(), Instance(), and Terminate().
|
staticprotected |
Definition at line 164 of file Progress.cpp.
References Begin, lldb_private::Progress::ProgressData::debugger_id, lldb::eBroadcastBitProgressCategory, lldb_private::Progress::kNonDeterministicTotal, lldb_private::Progress::ProgressData::progress_id, lldb_private::Debugger::ReportProgress(), and lldb_private::Progress::ProgressData::title.
Referenced by Expire(), and Increment().
|
static |
Definition at line 93 of file Progress.cpp.
References InstanceImpl().
Referenced by lldb_private::SystemInitializerFull::Terminate().
|
protected |
Alarm instance to coalesce progress events.
Definition at line 192 of file Progress.h.
Referenced by Decrement(), and Increment().
|
protected |
Map used for bookkeeping.
Definition at line 186 of file Progress.h.
Referenced by Decrement(), Expire(), and Increment().
|
protected |
Mutex to provide the map.
Definition at line 189 of file Progress.h.
Referenced by Decrement(), Expire(), and Increment().