Don't print a 'Total Execution Time' line for the 'Miscellaneous Ungrouped
authorChris Lattner <sabre@nondot.org>
Wed, 9 Feb 2005 18:41:32 +0000 (18:41 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 9 Feb 2005 18:41:32 +0000 (18:41 +0000)
Timers' section.  Since these are random timers in the program it doesn't
make sense to sum them up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20090 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Timer.cpp

index 3713f7f69ca57237f0c2dada883a09c97f4644b5..382825a2a4ee1958034febb508a509f94bd98557 100644 (file)
@@ -302,12 +302,20 @@ void TimerGroup::removeTimer() {
       *OutStream << "===" << std::string(73, '-') << "===\n"
                  << std::string(Padding, ' ') << Name << "\n"
                  << "===" << std::string(73, '-')
-                 << "===\n  Total Execution Time: ";
-
-      printAlignedFP(Total.getProcessTime(), 4, 5, *OutStream);
-      *OutStream << " seconds (";
-      printAlignedFP(Total.getWallTime(), 4, 5, *OutStream);
-      *OutStream << " wall clock)\n\n";
+                 << "===\n";
+
+      // If this is not an collection of ungrouped times, print the total time.
+      // Ungrouped timers don't really make sense to add up.  We still print the
+      // TOTAL line to make the percentages make sense.
+      if (this != DefaultTimerGroup) {
+        *OutStream << "  Total Execution Time: ";
+
+        printAlignedFP(Total.getProcessTime(), 4, 5, *OutStream);
+        *OutStream << " seconds (";
+        printAlignedFP(Total.getWallTime(), 4, 5, *OutStream);
+        *OutStream << " wall clock)\n";
+      }
+      *OutStream << "\n";
 
       if (Total.UserTime)
         *OutStream << "   ---User Time---";