summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Lee <davelee.com@gmail.com>2022-01-20 14:18:20 -0800
committerDave Lee <davelee.com@gmail.com>2022-01-21 15:34:07 -0800
commit58ee14e29e98384bba6d2e1c1789b7f8e3060d24 (patch)
tree15b863d47926b481d3b5fa1a63d0ef80fde7db80
parent6ba1fb04214bad08b8b19afba91798818ea276e5 (diff)
[lldb] Fix timer logging inverted quiet condition
The logic of `g_quiet` was inverted in D26243. This corrects the issue. Without this, running `log timers enable` produces a high volume of incremental timer output. Differential Revision: https://reviews.llvm.org/D117837
-rw-r--r--lldb/source/Utility/Timer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Utility/Timer.cpp b/lldb/source/Utility/Timer.cpp
index 2f3afe4c8703..b190f35007d5 100644
--- a/lldb/source/Utility/Timer.cpp
+++ b/lldb/source/Utility/Timer.cpp
@@ -63,7 +63,7 @@ Timer::Timer(Timer::Category &category, const char *format, ...)
TimerStack &stack = GetTimerStackForCurrentThread();
stack.push_back(this);
- if (g_quiet && stack.size() <= g_display_depth) {
+ if (!g_quiet && stack.size() <= g_display_depth) {
std::lock_guard<std::mutex> lock(GetFileMutex());
// Indent
@@ -89,7 +89,7 @@ Timer::~Timer() {
Signposts->endInterval(this, m_category.GetName());
TimerStack &stack = GetTimerStackForCurrentThread();
- if (g_quiet && stack.size() <= g_display_depth) {
+ if (!g_quiet && stack.size() <= g_display_depth) {
std::lock_guard<std::mutex> lock(GetFileMutex());
::fprintf(stdout, "%*s%.9f sec (%.9f sec)\n",
int(stack.size() - 1) * TIMER_INDENT_AMOUNT, "",