summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-31 00:13:26 +0000
committerChris Lattner <sabre@nondot.org>2003-10-31 00:13:26 +0000
commite1ccadf58cf71d8c2a975eb564ee1497ec508854 (patch)
tree68c690765abd01f828a51c62a1926ff4e6441d74 /tools
parent3baed416728ae1c818767cfc733c99e0dceaaeae (diff)
downloadllvm-e1ccadf58cf71d8c2a975eb564ee1497ec508854.tar.gz
llvm-e1ccadf58cf71d8c2a975eb564ee1497ec508854.tar.bz2
llvm-e1ccadf58cf71d8c2a975eb564ee1497ec508854.tar.xz
Add percentage info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-prof/llvm-prof.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/llvm-prof/llvm-prof.cpp b/tools/llvm-prof/llvm-prof.cpp
index a63137b284..e9f6d99146 100644
--- a/tools/llvm-prof/llvm-prof.cpp
+++ b/tools/llvm-prof/llvm-prof.cpp
@@ -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(" ## \tFrequency\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. %5u/%llu\t%s() - %s\n", i+1,
+ printf("%3d. %5.2f%% %5u/%llu\t%s() - %s\n", i+1,
+ Counts[i].second/(double)TotalExecutions*100,
Counts[i].second, TotalExecutions,
F->getName().c_str(), Counts[i].first->getName().c_str());
FunctionsToPrint.insert(F);