aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Utility/Timer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Utility/Timer.cpp')
-rw-r--r--lldb/source/Utility/Timer.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lldb/source/Utility/Timer.cpp b/lldb/source/Utility/Timer.cpp
index 7ead51069529..b59ce3b9f556 100644
--- a/lldb/source/Utility/Timer.cpp
+++ b/lldb/source/Utility/Timer.cpp
@@ -16,10 +16,10 @@
#include <utility>
#include <vector>
-#include <assert.h>
-#include <inttypes.h>
-#include <stdarg.h>
-#include <stdio.h>
+#include <cassert>
+#include <cinttypes>
+#include <cstdarg>
+#include <cstdio>
using namespace lldb_private;
@@ -33,6 +33,8 @@ static std::atomic<Timer::Category *> g_categories;
/// Allows llvm::Timer to emit signposts when supported.
static llvm::ManagedStatic<llvm::SignpostEmitter> Signposts;
+llvm::SignpostEmitter &lldb_private::GetSignposts() { return *Signposts; }
+
std::atomic<bool> Timer::g_quiet(true);
std::atomic<unsigned> Timer::g_display_depth(0);
static std::mutex &GetFileMutex() {
@@ -59,7 +61,6 @@ void Timer::SetQuiet(bool value) { g_quiet = value; }
Timer::Timer(Timer::Category &category, const char *format, ...)
: m_category(category), m_total_start(std::chrono::steady_clock::now()) {
- Signposts->startInterval(this, m_category.GetName());
TimerStack &stack = GetTimerStackForCurrentThread();
stack.push_back(this);
@@ -86,8 +87,6 @@ Timer::~Timer() {
auto total_dur = stop_time - m_total_start;
auto timer_dur = total_dur - m_child_duration;
- Signposts->endInterval(this, m_category.GetName());
-
TimerStack &stack = GetTimerStackForCurrentThread();
if (g_quiet && stack.size() <= g_display_depth) {
std::lock_guard<std::mutex> lock(GetFileMutex());