Changeset 32760 in webkit for trunk/JavaScriptCore/profiler/Profiler.cpp
- Timestamp:
- May 1, 2008, 9:32:32 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/profiler/Profiler.cpp
r32495 r32760 178 178 } 179 179 180 typedef pair<UString::Rep*, unsigned> NameCountPair; 181 182 static inline bool functionNameCountPairComparator(const NameCountPair a, const NameCountPair b) 183 { 184 return a.second > b.second; 185 } 186 180 187 void Profiler::printDataSampleStyle() const 181 188 { 189 typedef Vector<NameCountPair> NameCountPairVector; 190 191 FunctionCallHashCount countedFunctions; 182 192 printf("Call graph:\n"); 183 m_callTree->printDataSampleStyle(0); 184 185 // FIXME: Since no one seems to understand this part of sample's output I will implement it when I have a better idea of what it's meant to be doing. 186 printf("\nTotal number in stack (recursive counted multiple, when >=5):\n"); 193 m_callTree->printDataSampleStyle(0, countedFunctions); 194 195 printf("\nTotal number in stack:\n"); 196 NameCountPairVector sortedFunctions(countedFunctions.size()); 197 copyToVector(countedFunctions, sortedFunctions); 198 199 std::sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator); 200 for (NameCountPairVector::iterator it = sortedFunctions.begin(); it != sortedFunctions.end(); ++it) 201 printf(" %-12d%s\n", (*it).second, UString((*it).first).UTF8String().c_str()); 202 187 203 printf("\nSort by top of stack, same collapsed (when >= 5):\n"); 188 204 }
Note:
See TracChangeset
for help on using the changeset viewer.