void Profile::debugPrintDataSampleStyle() const { typedef Vector<NameCountPair> NameCountPairVector; FunctionCallHashCount countedFunctions; dataLogF("Call graph:\n"); m_head->debugPrintDataSampleStyle(0, countedFunctions); dataLogF("\nTotal number in stack:\n"); NameCountPairVector sortedFunctions(countedFunctions.size()); copyToVector(countedFunctions, sortedFunctions); std::sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator); for (NameCountPairVector::iterator it = sortedFunctions.begin(); it != sortedFunctions.end(); ++it) dataLogF(" %-12d%s\n", (*it).value, String((*it).key).utf8().data()); dataLogF("\nSort by top of stack, same collapsed (when >= 5):\n"); }
void Profile::debugPrintDataSampleStyle() const { typedef Vector<NameCountPair> NameCountPairVector; FunctionCallHashCount countedFunctions; printf("Call graph:\n"); m_head->debugPrintDataSampleStyle(0, countedFunctions); printf("\nTotal number in stack:\n"); NameCountPairVector sortedFunctions(countedFunctions.size()); copyToVector(countedFunctions, sortedFunctions); #if PLATFORM(ANDROID) _sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator); #else std::sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator); #endif for (NameCountPairVector::iterator it = sortedFunctions.begin(); it != sortedFunctions.end(); ++it) printf(" %-12d%s\n", (*it).second, UString((*it).first).UTF8String().c_str()); printf("\nSort by top of stack, same collapsed (when >= 5):\n"); }
void Profile::debugPrintSampleStyle() { typedef Vector<NameCountPair> NameCountPairVector; CalculateProfileSubtreeDataFunctor functor; m_rootNode->forEachNodePostorder(functor); ProfileNode::ProfileSubtreeData data = functor.returnValue(); FunctionCallHashCount countedFunctions; dataLogF("Call graph:\n"); m_rootNode->debugPrintSampleStyleRecursively(0, countedFunctions, data); dataLogF("\nTotal number in stack:\n"); NameCountPairVector sortedFunctions(countedFunctions.size()); copyToVector(countedFunctions, sortedFunctions); std::sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator); for (NameCountPairVector::iterator it = sortedFunctions.begin(); it != sortedFunctions.end(); ++it) dataLogF(" %-12d%s\n", (*it).value, String((*it).key).utf8().data()); dataLogF("\nSort by top of stack, same collapsed (when >= 5):\n"); }