From ad0d549d4cc13433f77c1ac8f0ab379c83d93f28 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 24 Feb 2012 16:36:50 +0100 Subject: Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 (http://svn.webkit.org/repository/webkit/trunk@108790) --- Source/JavaScriptCore/tools/CodeProfile.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Source/JavaScriptCore/tools/CodeProfile.cpp') 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(*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, "\n", m_file.data(), m_lineNo); + dataLog("\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(profile.childCount())); + dataLog("Total samples: %lld\n", static_cast(profile.childCount())); profile.dump(); for (size_t i = 0 ; i < m_children.size(); ++i) m_children[i]->report(); - fprintf(stdout, "\n", m_file.data(), m_lineNo); + dataLog("\n", m_file.data(), m_lineNo); } } -- cgit v1.2.1