[llvm-commits] CVS: llvm/tools/llvm-prof/llvm-prof.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Oct 30 18:08:00 PST 2003


Changes in directory llvm/tools/llvm-prof:

llvm-prof.cpp updated: 1.10 -> 1.11

---
Log message:

Hrm, some of my counters are wrapping around 32 bits


---
Diffs of the changes:  (+5 -4)

Index: llvm/tools/llvm-prof/llvm-prof.cpp
diff -u llvm/tools/llvm-prof/llvm-prof.cpp:1.10 llvm/tools/llvm-prof/llvm-prof.cpp:1.11
--- llvm/tools/llvm-prof/llvm-prof.cpp:1.10	Thu Oct 30 17:44:28 2003
+++ llvm/tools/llvm-prof/llvm-prof.cpp	Thu Oct 30 18:06:57 2003
@@ -104,7 +104,7 @@
   std::sort(FunctionCounts.begin(), FunctionCounts.end(),
             PairSecondSortReverse<Function*>());
 
-  unsigned TotalExecutions = 0;
+  unsigned long long TotalExecutions = 0;
   for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i)
     TotalExecutions += FunctionCounts[i].second;
   
@@ -131,7 +131,7 @@
       break;
     }
 
-    printf("%3d. %5d/%d %s\n", i+1, FunctionCounts[i].second, TotalExecutions,
+    printf("%3d. %5u/%llu %s\n", i+1, FunctionCounts[i].second, TotalExecutions,
            FunctionCounts[i].first->getName().c_str());
   }
 
@@ -155,12 +155,13 @@
     std::cout << "Top 20 most frequently executed basic blocks:\n\n";
 
     // Print out the function frequencies...
-    printf(" ##   Frequency\n");
+    printf(" ##  \tFrequency\n");
     unsigned BlocksToPrint = Counts.size();
     if (BlocksToPrint > 20) BlocksToPrint = 20;
     for (unsigned i = 0; i != BlocksToPrint; ++i) {
       Function *F = Counts[i].first->getParent();
-      printf("%3d. %5d/%d %s() - %s\n", i+1, Counts[i].second, TotalExecutions,
+      printf("%3d. %5u/%llu\t%s() - %s\n", i+1,
+             Counts[i].second, TotalExecutions,
              F->getName().c_str(), Counts[i].first->getName().c_str());
       FunctionsToPrint.insert(F);
     }





More information about the llvm-commits mailing list