diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
commit | ad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (patch) | |
tree | b34b0daceb7c8e7fdde4b4ec43650ab7caadb0a9 /Source/JavaScriptCore/profiler | |
parent | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (diff) | |
download | qtwebkit-ad0d549d4cc13433f77c1ac8f0ab379c83d93f28.tar.gz |
Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 (http://svn.webkit.org/repository/webkit/trunk@108790)
Diffstat (limited to 'Source/JavaScriptCore/profiler')
-rw-r--r-- | Source/JavaScriptCore/profiler/Profile.cpp | 11 | ||||
-rw-r--r-- | Source/JavaScriptCore/profiler/ProfileNode.cpp | 19 |
2 files changed, 16 insertions, 14 deletions
diff --git a/Source/JavaScriptCore/profiler/Profile.cpp b/Source/JavaScriptCore/profiler/Profile.cpp index 1a84518c1..49d6de97a 100644 --- a/Source/JavaScriptCore/profiler/Profile.cpp +++ b/Source/JavaScriptCore/profiler/Profile.cpp @@ -28,6 +28,7 @@ #include "ProfileNode.h" #include <stdio.h> +#include <wtf/DataLog.h> namespace JSC { @@ -102,7 +103,7 @@ void Profile::restoreAll() #ifndef NDEBUG void Profile::debugPrintData() const { - printf("Call graph:\n"); + dataLog("Call graph:\n"); m_head->debugPrintData(0); } @@ -118,18 +119,18 @@ void Profile::debugPrintDataSampleStyle() const typedef Vector<NameCountPair> NameCountPairVector; FunctionCallHashCount countedFunctions; - printf("Call graph:\n"); + dataLog("Call graph:\n"); m_head->debugPrintDataSampleStyle(0, countedFunctions); - printf("\nTotal number in stack:\n"); + dataLog("\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) - printf(" %-12d%s\n", (*it).second, UString((*it).first).utf8().data()); + dataLog(" %-12d%s\n", (*it).second, UString((*it).first).utf8().data()); - printf("\nSort by top of stack, same collapsed (when >= 5):\n"); + dataLog("\nSort by top of stack, same collapsed (when >= 5):\n"); } #endif diff --git a/Source/JavaScriptCore/profiler/ProfileNode.cpp b/Source/JavaScriptCore/profiler/ProfileNode.cpp index 8f20bbeff..ab43d1511 100644 --- a/Source/JavaScriptCore/profiler/ProfileNode.cpp +++ b/Source/JavaScriptCore/profiler/ProfileNode.cpp @@ -32,6 +32,7 @@ #include "Profiler.h" #include <stdio.h> #include <wtf/DateMath.h> +#include <wtf/DataLog.h> #include <wtf/text/StringHash.h> #if OS(WINDOWS) @@ -293,9 +294,9 @@ void ProfileNode::debugPrintData(int indentLevel) const { // Print function names for (int i = 0; i < indentLevel; ++i) - printf(" "); + dataLog(" "); - printf("Function Name %s %d SelfTime %.3fms/%.3f%% TotalTime %.3fms/%.3f%% VSelf %.3fms VTotal %.3fms Visible %s Next Sibling %s\n", + dataLog("Function Name %s %d SelfTime %.3fms/%.3f%% TotalTime %.3fms/%.3f%% VSelf %.3fms VTotal %.3fms Visible %s Next Sibling %s\n", functionName().utf8().data(), m_numberOfCalls, m_actualSelfTime, selfPercent(), m_actualTotalTime, totalPercent(), m_visibleSelfTime, m_visibleTotalTime, @@ -312,20 +313,20 @@ void ProfileNode::debugPrintData(int indentLevel) const // print the profiled data in a format that matches the tool sample's output. double ProfileNode::debugPrintDataSampleStyle(int indentLevel, FunctionCallHashCount& countedFunctions) const { - printf(" "); + dataLog(" "); // Print function names const char* name = functionName().utf8().data(); double sampleCount = m_actualTotalTime * 1000; if (indentLevel) { for (int i = 0; i < indentLevel; ++i) - printf(" "); + dataLog(" "); countedFunctions.add(functionName().impl()); - printf("%.0f %s\n", sampleCount ? sampleCount : 1, name); + dataLog("%.0f %s\n", sampleCount ? sampleCount : 1, name); } else - printf("%s\n", name); + dataLog("%s\n", name); ++indentLevel; @@ -337,11 +338,11 @@ double ProfileNode::debugPrintDataSampleStyle(int indentLevel, FunctionCallHashC sumOfChildrensCount *= 1000; // // Print remainder of samples to match sample's output if (sumOfChildrensCount < sampleCount) { - printf(" "); + dataLog(" "); while (indentLevel--) - printf(" "); + dataLog(" "); - printf("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().utf8().data()); + dataLog("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().utf8().data()); } return m_actualTotalTime; |