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/tools/CodeProfile.cpp | |
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/tools/CodeProfile.cpp')
-rw-r--r-- | Source/JavaScriptCore/tools/CodeProfile.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/JavaScriptCore/tools/CodeProfile.cpp b/Source/JavaScriptCore/tools/CodeProfile.cpp index 7794f58d3..349353eb2 100644 --- a/Source/JavaScriptCore/tools/CodeProfile.cpp +++ b/Source/JavaScriptCore/tools/CodeProfile.cpp @@ -123,10 +123,14 @@ void CodeProfile::sample(void* pc, void** framePointer) if (type != EngineFrame) return; - // Walk up the stack. #if PLATFORM(MAC) && CPU(X86_64) + // Walk up the stack. pc = framePointer[1]; framePointer = reinterpret_cast<void**>(*framePointer); +#elif OS(LINUX) && CPU(X86) + // Don't unwind the stack as some dependent third party libraries + // may be compiled with -fomit-frame-pointer. + framePointer = 0; #else // This platform is not yet supported! ASSERT_NOT_REACHED(); @@ -139,7 +143,7 @@ void CodeProfile::sample(void* pc, void** framePointer) void CodeProfile::report() { - fprintf(stdout, "<CodeProfiling %s:%d>\n", m_file.data(), m_lineNo); + dataLog("<CodeProfiling %s:%d>\n", m_file.data(), m_lineNo); // How many frames of C-code to print - 0, if not verbose, 1 if verbose, up to 1024 if very verbose. unsigned recursionLimit = CodeProfiling::beVeryVerbose() ? 1024 : CodeProfiling::beVerbose(); @@ -176,13 +180,13 @@ void CodeProfile::report() } // Output the profile tree. - fprintf(stdout, "Total samples: %lld\n", static_cast<long long>(profile.childCount())); + dataLog("Total samples: %lld\n", static_cast<long long>(profile.childCount())); profile.dump(); for (size_t i = 0 ; i < m_children.size(); ++i) m_children[i]->report(); - fprintf(stdout, "</CodeProfiling %s:%d>\n", m_file.data(), m_lineNo); + dataLog("</CodeProfiling %s:%d>\n", m_file.data(), m_lineNo); } } |