[Lldb-commits] [PATCH] D117837: [lldb] Fix timer logging inverted quiet condition

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 20 14:20:33 PST 2022


kastiglione created this revision.
kastiglione added reviewers: JDevlieghere, labath.
kastiglione requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

The logic of `g_quiet` was inverted in D26243 <https://reviews.llvm.org/D26243>. This corrects the issue.

Without this, running `log timers enable` produces a high volume of incremental
timer output.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117837

Files:
  lldb/source/Utility/Timer.cpp


Index: lldb/source/Utility/Timer.cpp
===================================================================
--- lldb/source/Utility/Timer.cpp
+++ lldb/source/Utility/Timer.cpp
@@ -63,7 +63,7 @@
   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 @@
   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, "",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117837.401783.patch
Type: text/x-patch
Size: 862 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220120/130950fc/attachment.bin>


More information about the lldb-commits mailing list