Changeset 107499 in webkit for trunk/Source/JavaScriptCore/profiler
- Timestamp:
- Feb 11, 2012, 7:21:32 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore/profiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/profiler/Profile.cpp
r95901 r107499 29 29 #include "ProfileNode.h" 30 30 #include <stdio.h> 31 #include <wtf/DataLog.h> 31 32 32 33 namespace JSC { … … 103 104 void Profile::debugPrintData() const 104 105 { 105 printf("Call graph:\n");106 dataLog("Call graph:\n"); 106 107 m_head->debugPrintData(0); 107 108 } … … 119 120 120 121 FunctionCallHashCount countedFunctions; 121 printf("Call graph:\n");122 dataLog("Call graph:\n"); 122 123 m_head->debugPrintDataSampleStyle(0, countedFunctions); 123 124 124 printf("\nTotal number in stack:\n");125 dataLog("\nTotal number in stack:\n"); 125 126 NameCountPairVector sortedFunctions(countedFunctions.size()); 126 127 copyToVector(countedFunctions, sortedFunctions); … … 128 129 std::sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator); 129 130 for (NameCountPairVector::iterator it = sortedFunctions.begin(); it != sortedFunctions.end(); ++it) 130 printf(" %-12d%s\n", (*it).second, UString((*it).first).utf8().data());131 dataLog(" %-12d%s\n", (*it).second, UString((*it).first).utf8().data()); 131 132 132 printf("\nSort by top of stack, same collapsed (when >= 5):\n");133 dataLog("\nSort by top of stack, same collapsed (when >= 5):\n"); 133 134 } 134 135 #endif -
trunk/Source/JavaScriptCore/profiler/ProfileNode.cpp
r95901 r107499 33 33 #include <stdio.h> 34 34 #include <wtf/DateMath.h> 35 #include <wtf/DataLog.h> 35 36 #include <wtf/text/StringHash.h> 36 37 … … 294 295 // Print function names 295 296 for (int i = 0; i < indentLevel; ++i) 296 printf(" ");297 298 printf("Function Name %s %d SelfTime %.3fms/%.3f%% TotalTime %.3fms/%.3f%% VSelf %.3fms VTotal %.3fms Visible %s Next Sibling %s\n",297 dataLog(" "); 298 299 dataLog("Function Name %s %d SelfTime %.3fms/%.3f%% TotalTime %.3fms/%.3f%% VSelf %.3fms VTotal %.3fms Visible %s Next Sibling %s\n", 299 300 functionName().utf8().data(), 300 301 m_numberOfCalls, m_actualSelfTime, selfPercent(), m_actualTotalTime, totalPercent(), … … 313 314 double ProfileNode::debugPrintDataSampleStyle(int indentLevel, FunctionCallHashCount& countedFunctions) const 314 315 { 315 printf(" ");316 dataLog(" "); 316 317 317 318 // Print function names … … 320 321 if (indentLevel) { 321 322 for (int i = 0; i < indentLevel; ++i) 322 printf(" ");323 dataLog(" "); 323 324 324 325 countedFunctions.add(functionName().impl()); 325 326 326 printf("%.0f %s\n", sampleCount ? sampleCount : 1, name);327 dataLog("%.0f %s\n", sampleCount ? sampleCount : 1, name); 327 328 } else 328 printf("%s\n", name);329 dataLog("%s\n", name); 329 330 330 331 ++indentLevel; … … 338 339 // Print remainder of samples to match sample's output 339 340 if (sumOfChildrensCount < sampleCount) { 340 printf(" ");341 dataLog(" "); 341 342 while (indentLevel--) 342 printf(" ");343 344 printf("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().utf8().data());343 dataLog(" "); 344 345 dataLog("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().utf8().data()); 345 346 } 346 347
Note:
See TracChangeset
for help on using the changeset viewer.