Bug 731272 - Add the current instruction to the top of the stack. r=jrmuizel
authorMarkus Stange <mstange@themasta.com>
Thu, 22 Mar 2012 23:31:56 +0100
changeset 91897 7c54ec42cb08cf2f6ce79510ade6945ff4a9459f
parent 91896 046fa26497e9a0d1a4b30eca686d498ca9671a6b
child 91898 f42ea2a158e451a490db2c0435fc57885ac349be
push idunknown
push userunknown
push dateunknown
reviewersjrmuizel
bugs731272
milestone14.0a1
Bug 731272 - Add the current instruction to the top of the stack. r=jrmuizel
tools/profiler/TableTicker.cpp
--- a/tools/profiler/TableTicker.cpp
+++ b/tools/profiler/TableTicker.cpp
@@ -518,16 +518,20 @@ void TableTicker::doBacktrace(ThreadProf
   MOZ_ASSERT(thread);
 #endif
   void* pc_array[1000];
   PCArray array = {
     pc_array,
     mozilla::ArrayLength(pc_array),
     0
   };
+
+  // Start with the current function.
+  StackWalkCallback(aSample->pc, &array);
+
 #ifdef XP_MACOSX
   pthread_t pt = GetProfiledThread(platform_data());
   void *stackEnd = reinterpret_cast<void*>(-1);
   if (pt)
     stackEnd = static_cast<char*>(pthread_get_stackaddr_np(pt));
   nsresult rv = FramePointerStackWalk(StackWalkCallback, 0, &array, reinterpret_cast<void**>(aSample->fp), stackEnd);
 #else
   nsresult rv = NS_StackWalk(StackWalkCallback, 0, &array, thread);