summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-prof/llvm-prof.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-28 22:30:37 +0000
committerChris Lattner <sabre@nondot.org>2003-10-28 22:30:37 +0000
commit2343a0eed2a8173fd4e6c2b4839dea1c25c75d74 (patch)
tree6394777788d53361afff9a9c00e93352e040f551 /llvm/tools/llvm-prof/llvm-prof.cpp
parent8fb7af1ee7cc0bd95745a50c675b96c38605a460 (diff)
downloadbcm5719-llvm-2343a0eed2a8173fd4e6c2b4839dea1c25c75d74.tar.gz
bcm5719-llvm-2343a0eed2a8173fd4e6c2b4839dea1c25c75d74.zip
Print out command lines used to run the programs
llvm-svn: 9562
Diffstat (limited to 'llvm/tools/llvm-prof/llvm-prof.cpp')
-rw-r--r--llvm/tools/llvm-prof/llvm-prof.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/llvm/tools/llvm-prof/llvm-prof.cpp b/llvm/tools/llvm-prof/llvm-prof.cpp
index 2b6730ec64a..c487da959ff 100644
--- a/llvm/tools/llvm-prof/llvm-prof.cpp
+++ b/llvm/tools/llvm-prof/llvm-prof.cpp
@@ -73,11 +73,30 @@ int main(int argc, char **argv) {
for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i)
TotalExecutions += FunctionCounts[i].second;
+ std::cout << "===" << std::string(73, '-') << "===\n"
+ << "LLVM profiling output for:\n";
+
+ for (unsigned i = 0, e = PI.getNumExecutions(); i != e; ++i) {
+ std::cout << " ";
+ if (e != 1) std::cout << i << ". ";
+ std::cout << PI.getExecution(i) << "\n";
+ }
+
+ std::cout << "\n===" << std::string(73, '-') << "===\n";
+ std::cout << "Function execution frequencies:\n\n";
+
// Print out the function frequencies...
printf(" ## Frequency\n");
- for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i)
+ for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i) {
+ if (FunctionCounts[i].second == 0) {
+ printf("\n NOTE: %d function%s never executed!\n",
+ e-i, e-i-1 ? "s were" : " was");
+ break;
+ }
+
printf("%3d. %5d/%d %s\n", i, FunctionCounts[i].second, TotalExecutions,
FunctionCounts[i].first->getName().c_str());
+ }
// If we have block count information, print out the LLVM module with
OpenPOWER on IntegriCloud