diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:09:45 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:10:13 +0100 |
commit | 470286ecfe79d59df14944e5b5d34630fc739391 (patch) | |
tree | 43983212872e06cebefd2ae474418fa2908ca54c /Source/JavaScriptCore/profiler | |
parent | 23037105e948c2065da5a937d3a2396b0ff45c1e (diff) | |
download | qtwebkit-470286ecfe79d59df14944e5b5d34630fc739391.tar.gz |
Imported WebKit commit e89504fa9195b2063b2530961d4b73dd08de3242 (http://svn.webkit.org/repository/webkit/trunk@135485)
Change-Id: I03774e5ac79721c13ffa30d152537a74d0b12e66
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/profiler')
-rw-r--r-- | Source/JavaScriptCore/profiler/Profile.cpp | 10 | ||||
-rw-r--r-- | Source/JavaScriptCore/profiler/ProfileNode.cpp | 18 | ||||
-rw-r--r-- | Source/JavaScriptCore/profiler/ProfileNode.h | 1 |
3 files changed, 15 insertions, 14 deletions
diff --git a/Source/JavaScriptCore/profiler/Profile.cpp b/Source/JavaScriptCore/profiler/Profile.cpp index a641580ec..2274889a1 100644 --- a/Source/JavaScriptCore/profiler/Profile.cpp +++ b/Source/JavaScriptCore/profiler/Profile.cpp @@ -103,7 +103,7 @@ void Profile::restoreAll() #ifndef NDEBUG void Profile::debugPrintData() const { - dataLog("Call graph:\n"); + dataLogF("Call graph:\n"); m_head->debugPrintData(0); } @@ -119,18 +119,18 @@ void Profile::debugPrintDataSampleStyle() const typedef Vector<NameCountPair> NameCountPairVector; FunctionCallHashCount countedFunctions; - dataLog("Call graph:\n"); + dataLogF("Call graph:\n"); m_head->debugPrintDataSampleStyle(0, countedFunctions); - dataLog("\nTotal number in stack:\n"); + 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) - dataLog(" %-12d%s\n", (*it).value, String((*it).key).utf8().data()); + dataLogF(" %-12d%s\n", (*it).value, String((*it).key).utf8().data()); - dataLog("\nSort by top of stack, same collapsed (when >= 5):\n"); + dataLogF("\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 ab43d1511..6c36e47d0 100644 --- a/Source/JavaScriptCore/profiler/ProfileNode.cpp +++ b/Source/JavaScriptCore/profiler/ProfileNode.cpp @@ -294,9 +294,9 @@ void ProfileNode::debugPrintData(int indentLevel) const { // Print function names for (int i = 0; i < indentLevel; ++i) - dataLog(" "); + dataLogF(" "); - dataLog("Function Name %s %d SelfTime %.3fms/%.3f%% TotalTime %.3fms/%.3f%% VSelf %.3fms VTotal %.3fms Visible %s Next Sibling %s\n", + dataLogF("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, @@ -313,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 { - dataLog(" "); + dataLogF(" "); // Print function names const char* name = functionName().utf8().data(); double sampleCount = m_actualTotalTime * 1000; if (indentLevel) { for (int i = 0; i < indentLevel; ++i) - dataLog(" "); + dataLogF(" "); countedFunctions.add(functionName().impl()); - dataLog("%.0f %s\n", sampleCount ? sampleCount : 1, name); + dataLogF("%.0f %s\n", sampleCount ? sampleCount : 1, name); } else - dataLog("%s\n", name); + dataLogF("%s\n", name); ++indentLevel; @@ -338,11 +338,11 @@ double ProfileNode::debugPrintDataSampleStyle(int indentLevel, FunctionCallHashC sumOfChildrensCount *= 1000; // // Print remainder of samples to match sample's output if (sumOfChildrensCount < sampleCount) { - dataLog(" "); + dataLogF(" "); while (indentLevel--) - dataLog(" "); + dataLogF(" "); - dataLog("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().utf8().data()); + dataLogF("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().utf8().data()); } return m_actualTotalTime; diff --git a/Source/JavaScriptCore/profiler/ProfileNode.h b/Source/JavaScriptCore/profiler/ProfileNode.h index 26000a827..f5fef86f8 100644 --- a/Source/JavaScriptCore/profiler/ProfileNode.h +++ b/Source/JavaScriptCore/profiler/ProfileNode.h @@ -64,6 +64,7 @@ namespace JSC { // CallIdentifier members ExecState* callerCallFrame() const { return m_callerCallFrame; } const CallIdentifier& callIdentifier() const { return m_callIdentifier; } + unsigned long callUID() const { return m_callIdentifier.hash(); }; const String& functionName() const { return m_callIdentifier.m_name; } const String& url() const { return m_callIdentifier.m_url; } unsigned lineNumber() const { return m_callIdentifier.m_lineNumber; } |