This revision was automatically updated to reflect the committed changes.
Closed by commit rG5f69e6682bf0: [lldb][NFCI] Timer::DumpCategoryTimes should 
take a reference instead of a… (authored by bulbazord).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153711/new/

https://reviews.llvm.org/D153711

Files:
  lldb/include/lldb/Utility/Timer.h
  lldb/source/Commands/CommandObjectLog.cpp
  lldb/source/Utility/Timer.cpp
  lldb/unittests/Utility/TimerTest.cpp

Index: lldb/unittests/Utility/TimerTest.cpp
===================================================================
--- lldb/unittests/Utility/TimerTest.cpp
+++ lldb/unittests/Utility/TimerTest.cpp
@@ -21,7 +21,7 @@
     std::this_thread::sleep_for(std::chrono::milliseconds(10));
   }
   StreamString ss;
-  Timer::DumpCategoryTimes(&ss);
+  Timer::DumpCategoryTimes(ss);
   double seconds;
   ASSERT_EQ(1, sscanf(ss.GetData(), "%lf sec for CAT1", &seconds));
   EXPECT_LT(0.001, seconds);
@@ -39,7 +39,7 @@
     std::this_thread::sleep_for(std::chrono::milliseconds(10));
   }
   StreamString ss;
-  Timer::DumpCategoryTimes(&ss);
+  Timer::DumpCategoryTimes(ss);
   double seconds;
   // It should only appear once.
   ASSERT_EQ(ss.GetString().count("CAT1"), 1U);
@@ -59,7 +59,7 @@
     std::this_thread::sleep_for(std::chrono::milliseconds(10));
   }
   StreamString ss;
-  Timer::DumpCategoryTimes(&ss);
+  Timer::DumpCategoryTimes(ss);
   double seconds1, seconds2;
   ASSERT_EQ(2, sscanf(ss.GetData(),
                       "%lf sec (total: %*fs; child: %*fs; count: %*d) for "
@@ -92,7 +92,7 @@
   // 0.105202764 sec (total: 0.132s; child: 0.027s; count: 1) for CAT1
   // 0.026772798 sec (total: 0.027s; child: 0.000s; count: 2) for CAT2
   StreamString ss;
-  Timer::DumpCategoryTimes(&ss);
+  Timer::DumpCategoryTimes(ss);
   double seconds1, total1, child1, seconds2;
   int count1, count2;
   ASSERT_EQ(
Index: lldb/source/Utility/Timer.cpp
===================================================================
--- lldb/source/Utility/Timer.cpp
+++ lldb/source/Utility/Timer.cpp
@@ -135,7 +135,7 @@
   }
 }
 
-void Timer::DumpCategoryTimes(Stream *s) {
+void Timer::DumpCategoryTimes(Stream &s) {
   std::vector<Stats> sorted;
   for (Category *i = g_categories; i; i = i->m_next) {
     uint64_t nanos = i->m_nanos.load(std::memory_order_acquire);
@@ -153,9 +153,9 @@
   llvm::sort(sorted, CategoryMapIteratorSortCriterion);
 
   for (const auto &stats : sorted)
-    s->Printf("%.9f sec (total: %.3fs; child: %.3fs; count: %" PRIu64
-              ") for %s\n",
-              stats.nanos / 1000000000., stats.nanos_total / 1000000000.,
-              (stats.nanos_total - stats.nanos) / 1000000000., stats.count,
-              stats.name);
+    s.Printf("%.9f sec (total: %.3fs; child: %.3fs; count: %" PRIu64
+             ") for %s\n",
+             stats.nanos / 1000000000., stats.nanos_total / 1000000000.,
+             (stats.nanos_total - stats.nanos) / 1000000000., stats.count,
+             stats.name);
 }
Index: lldb/source/Commands/CommandObjectLog.cpp
===================================================================
--- lldb/source/Commands/CommandObjectLog.cpp
+++ lldb/source/Commands/CommandObjectLog.cpp
@@ -504,7 +504,7 @@
 
 protected:
   bool DoExecute(Args &args, CommandReturnObject &result) override {
-    Timer::DumpCategoryTimes(&result.GetOutputStream());
+    Timer::DumpCategoryTimes(result.GetOutputStream());
     Timer::SetDisplayDepth(0);
     result.SetStatus(eReturnStatusSuccessFinishResult);
 
@@ -527,7 +527,7 @@
 
 protected:
   bool DoExecute(Args &args, CommandReturnObject &result) override {
-    Timer::DumpCategoryTimes(&result.GetOutputStream());
+    Timer::DumpCategoryTimes(result.GetOutputStream());
     result.SetStatus(eReturnStatusSuccessFinishResult);
 
     if (!result.Succeeded()) {
Index: lldb/include/lldb/Utility/Timer.h
===================================================================
--- lldb/include/lldb/Utility/Timer.h
+++ lldb/include/lldb/Utility/Timer.h
@@ -56,7 +56,7 @@
 
   static void SetQuiet(bool value);
 
-  static void DumpCategoryTimes(Stream *s);
+  static void DumpCategoryTimes(Stream &s);
 
   static void ResetCategoryTimes();
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits]... Alex Langford via Phabricator via lldb-commits
    • [Lldb-com... Jonas Devlieghere via Phabricator via lldb-commits
    • [Lldb-com... Felipe de Azevedo Piovezan via Phabricator via lldb-commits
    • [Lldb-com... Alex Langford via Phabricator via lldb-commits

Reply via email to