diff options
author | Chris Lattner <sabre@nondot.org> | 2001-11-12 20:13:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-11-12 20:13:14 +0000 |
commit | 747f016184296c53a60294b8d6081c6a0423e7a0 (patch) | |
tree | a233bbcc647623fa5bfb39ac4adb153c2e9c0d28 /llvm/lib/ExecutionEngine/Interpreter/Execution.cpp | |
parent | 1643e8ec7b5a741e539a6e8f9f748a08ad6dfc98 (diff) | |
download | bcm5719-llvm-747f016184296c53a60294b8d6081c6a0423e7a0.tar.gz bcm5719-llvm-747f016184296c53a60294b8d6081c6a0423e7a0.zip |
Print percentages for profiling info better
llvm-svn: 1274
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/Interpreter/Execution.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp index 5c763d79fbd..692f8f425a4 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -603,7 +603,7 @@ static void PerformExitStuff() { #ifdef PROFILE_STRUCTURE_FIELDS // Print out structure field accounting information... if (!FieldAccessCounts.empty()) { - CW << "Field Access Profile Information:\n"; + CW << "Profile Field Access Counts:\n"; map<const StructType *, vector<unsigned> >::iterator I = FieldAccessCounts.begin(), E = FieldAccessCounts.end(); for (; I != E; ++I) { @@ -622,6 +622,24 @@ static void PerformExitStuff() { CW << endl; } CW << endl; + + CW << "Profile Field Access Percentages:\n"; + cout.precision(3); + for (I = FieldAccessCounts.begin(); I != E; ++I) { + vector<unsigned> &OfC = I->second; + unsigned Sum = 0; + for (unsigned i = 0; i < OfC.size(); ++i) + Sum += OfC[i]; + + CW << " '" << (Value*)I->first << "'\t- "; + for (unsigned i = 0; i < OfC.size(); ++i) { + if (i) CW << ", "; + CW << double(OfC[i])/Sum; + } + CW << endl; + } + CW << endl; + FieldAccessCounts.clear(); } #endif |