Changeset 32760 in webkit for trunk/JavaScriptCore/profiler/FunctionCallProfile.cpp
- Timestamp:
- May 1, 2008, 9:32:32 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/profiler/FunctionCallProfile.cpp
r32693 r32760 112 112 printf(" "); 113 113 114 printf("%. 0fms %s\n", m_timeSum, m_functionName.UTF8String().c_str());114 printf("%.3fms %s\n", m_timeSum, m_functionName.UTF8String().c_str()); 115 115 } else 116 116 printf("%s\n", m_functionName.UTF8String().c_str()); … … 124 124 125 125 // print the profiled data in a format that matches the tool sample's output. 126 double FunctionCallProfile::printDataSampleStyle(int indentLevel ) const126 double FunctionCallProfile::printDataSampleStyle(int indentLevel, FunctionCallHashCount& countedFunctions) const 127 127 { 128 128 printf(" "); 129 129 130 130 // Print function names 131 const char* name = m_functionName.UTF8String().c_str(); 132 double sampleCount = m_timeSum * 1000; 131 133 if (indentLevel) { 132 134 for (int i = 0; i < indentLevel; ++i) 133 135 printf(" "); 134 136 135 // We've previously asserted that m_timeSum will always be >= 1 136 printf("%.0f %s\n", m_timeSum ? m_timeSum : 1, m_functionName.UTF8String().c_str()); 137 countedFunctions.add(m_functionName.rep()); 138 139 printf("%.0f %s\n", sampleCount ? sampleCount : 1, name); 137 140 } else 138 printf("%s\n", m_functionName.UTF8String().c_str());141 printf("%s\n", name); 139 142 140 143 ++indentLevel; 141 144 142 145 // Print children's names and information 143 double sumOfChildrens Times= 0.0;146 double sumOfChildrensCount = 0.0; 144 147 for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) 145 sumOfChildrens Times += (*currentChild)->printDataSampleStyle(indentLevel);148 sumOfChildrensCount += (*currentChild)->printDataSampleStyle(indentLevel, countedFunctions); 146 149 147 // Print remainder of time to match sample's output 148 if (sumOfChildrensTimes < m_timeSum) { 150 sumOfChildrensCount *= 1000; // 151 // Print remainder of samples to match sample's output 152 if (sumOfChildrensCount < sampleCount) { 149 153 printf(" "); 150 154 while (indentLevel--) 151 155 printf(" "); 152 156 153 printf("% f %s\n", m_timeSum - sumOfChildrensTimes, m_functionName.UTF8String().c_str());157 printf("%.0f %s\n", sampleCount - sumOfChildrensCount, m_functionName.UTF8String().c_str()); 154 158 } 155 159
Note:
See TracChangeset
for help on using the changeset viewer.