summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/tools/CodeProfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/tools/CodeProfile.cpp')
-rw-r--r--Source/JavaScriptCore/tools/CodeProfile.cpp12
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);
}
}