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 | 84efe09e3d5dcda476f6baf53f24865e11ea78de (patch) | |
tree | dad6ea98f18e3057f27527db6faf089495318fdc /lib/ExecutionEngine | |
parent | fd79ab50889e1072958cb593a312d6861c5f34cb (diff) | |
download | external_llvm-84efe09e3d5dcda476f6baf53f24865e11ea78de.zip external_llvm-84efe09e3d5dcda476f6baf53f24865e11ea78de.tar.gz external_llvm-84efe09e3d5dcda476f6baf53f24865e11ea78de.tar.bz2 |
Print percentages for profiling info better
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1274 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r-- | lib/ExecutionEngine/Interpreter/Execution.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp index 5c763d7..692f8f4 100644 --- a/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/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 |