[Lldb-commits] [lldb] 58ee14e - [lldb] Fix timer logging inverted quiet condition

Dave Lee via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 21 15:34:13 PST 2022


Author: Dave Lee
Date: 2022-01-21T15:34:07-08:00
New Revision: 58ee14e29e98384bba6d2e1c1789b7f8e3060d24

URL: https://github.com/llvm/llvm-project/commit/58ee14e29e98384bba6d2e1c1789b7f8e3060d24
DIFF: https://github.com/llvm/llvm-project/commit/58ee14e29e98384bba6d2e1c1789b7f8e3060d24.diff

LOG: [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

Added: 
    

Modified: 
    lldb/source/Utility/Timer.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Utility/Timer.cpp b/lldb/source/Utility/Timer.cpp
index 2f3afe4c87037..b190f35007d50 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, "",


        


More information about the lldb-commits mailing list