[lldb] Fix timer logging inverted quiet condition
authorDave Lee <davelee.com@gmail.com>
Thu, 20 Jan 2022 22:18:20 +0000 (14:18 -0800)
committerDave Lee <davelee.com@gmail.com>
Fri, 21 Jan 2022 23:34:07 +0000 (15:34 -0800)
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

lldb/source/Utility/Timer.cpp

index 2f3afe4..b190f35 100644 (file)
@@ -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, "",