summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-prof/llvm-prof.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-31 00:06:57 +0000
committerChris Lattner <sabre@nondot.org>2003-10-31 00:06:57 +0000
commit0575f97e4b4d7aaf571f6518e5ae7cd153ab9bd1 (patch)
tree8cc87551942b6365940c4f525184fb884c518ed3 /llvm/tools/llvm-prof/llvm-prof.cpp
parentbabc99cf80d12933e2e2379e0403a5ee8f585929 (diff)
downloadbcm5719-llvm-0575f97e4b4d7aaf571f6518e5ae7cd153ab9bd1.tar.gz
bcm5719-llvm-0575f97e4b4d7aaf571f6518e5ae7cd153ab9bd1.zip
Hrm, some of my counters are wrapping around 32 bits
llvm-svn: 9623
Diffstat (limited to 'llvm/tools/llvm-prof/llvm-prof.cpp')
-rw-r--r--llvm/tools/llvm-prof/llvm-prof.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/tools/llvm-prof/llvm-prof.cpp b/llvm/tools/llvm-prof/llvm-prof.cpp
index 5911918b161..a63137b284a 100644
--- a/llvm/tools/llvm-prof/llvm-prof.cpp
+++ b/llvm/tools/llvm-prof/llvm-prof.cpp
@@ -104,7 +104,7 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
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);
}
OpenPOWER on IntegriCloud