Changeset 32228 in webkit for trunk/JavaScriptCore/profiler/FunctionCallProfile.cpp
- Timestamp:
- Apr 18, 2008, 2:49:56 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/profiler/FunctionCallProfile.cpp
r32198 r32228 62 62 m_timeSum += getCurrentUTCTime() - m_startTime; 63 63 64 ASSERT(m_timeSum > 0);64 // FIXME: We may need something with higher resolution than ms as some functions will take 0ms. 65 65 return; 66 66 } … … 97 97 } 98 98 99 void FunctionCallProfile::printDataInspectorStyle(int indentLevel) const 100 { 101 // Print function names 102 if (indentLevel) { 103 for (int i = 0; i < indentLevel; ++i) 104 printf(" "); 105 106 printf("%.0fms %s\n", m_timeSum, m_functionName.UTF8String().c_str()); 107 } else 108 printf("%s\n", m_functionName.UTF8String().c_str()); 109 110 ++indentLevel; 111 112 // Print children's names and information 113 for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) 114 (*currentChild)->printDataInspectorStyle(indentLevel); 115 } 116 99 117 // print the profiled data in a format that matches the tool sample's output. 100 double FunctionCallProfile::printDataSampleStyle(int indentLevel) 118 double FunctionCallProfile::printDataSampleStyle(int indentLevel) const 101 119 { 102 120 printf(" "); … … 108 126 109 127 // We've previously asserted that m_timeSum will always be >= 1 110 printf("% f %s\n", m_timeSum, m_functionName.UTF8String().c_str());128 printf("%.0f %s\n", m_timeSum ? m_timeSum : 1, m_functionName.UTF8String().c_str()); 111 129 } else 112 130 printf("%s\n", m_functionName.UTF8String().c_str());
Note:
See TracChangeset
for help on using the changeset viewer.