Print out command lines used to run the programs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9562 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llvm-prof/llvm-prof.cpp b/tools/llvm-prof/llvm-prof.cpp
index 2b6730e..c487da9 100644
--- a/tools/llvm-prof/llvm-prof.cpp
+++ b/tools/llvm-prof/llvm-prof.cpp
@@ -73,11 +73,30 @@
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