Bug 1330150 - Don't abandon sample if native stack walk fails (r=ehsan)
authorLuke Wagner <luke@mozilla.com>
Thu, 12 Jan 2017 17:40:20 -0600
changeset 374216 ba0df33538d8f585e9d01fdd886ece6c983564b0
parent 374215 4e9be7b6ff164b1f508140b86d7aceefa78522b5
child 374217 ea577d0f972a1c324810cbc490a56bd341b1d20d
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1330150
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1330150 - Don't abandon sample if native stack walk fails (r=ehsan) MozReview-Commit-ID: CyPPGEGX8R2
tools/profiler/core/GeckoSampler.cpp
--- a/tools/profiler/core/GeckoSampler.cpp
+++ b/tools/profiler/core/GeckoSampler.cpp
@@ -985,31 +985,31 @@ void GeckoSampler::doNativeBacktrace(Thr
   // doesn't use the frame number argument.
   StackWalkCallback(/* frameNumber */ 0, aSample->pc, aSample->sp, &nativeStack);
 
   uint32_t maxFrames = uint32_t(nativeStack.size - nativeStack.count);
   // win X64 doesn't support disabling frame pointers emission so we need
   // to fallback to using StackWalk64 which is slower.
 #if defined(XP_MACOSX) || (defined(XP_WIN) && !defined(V8_HOST_ARCH_X64))
   void *stackEnd = aSample->threadProfile->GetStackTop();
-  bool rv = true;
-  if (aSample->fp >= aSample->sp && aSample->fp <= stackEnd)
-    rv = FramePointerStackWalk(StackWalkCallback, /* skipFrames */ 0,
-                               maxFrames, &nativeStack,
-                               reinterpret_cast<void**>(aSample->fp), stackEnd);
+  if (aSample->fp >= aSample->sp && aSample->fp <= stackEnd) {
+    FramePointerStackWalk(StackWalkCallback, /* skipFrames */ 0, maxFrames,
+                          &nativeStack, reinterpret_cast<void**>(aSample->fp),
+                          stackEnd);
+  }
 #else
   void *platformData = nullptr;
 
   uintptr_t thread = GetThreadHandle(aSample->threadProfile->GetPlatformData());
   MOZ_ASSERT(thread);
-  bool rv = MozStackWalk(StackWalkCallback, /* skipFrames */ 0, maxFrames,
-                             &nativeStack, thread, platformData);
+  MozStackWalk(StackWalkCallback, /* skipFrames */ 0, maxFrames, &nativeStack,
+               thread, platformData);
 #endif
-  if (rv)
-    mergeStacksIntoProfile(aProfile, aSample, nativeStack);
+
+  mergeStacksIntoProfile(aProfile, aSample, nativeStack);
 }
 #endif
 
 
 #ifdef USE_EHABI_STACKWALK
 void GeckoSampler::doNativeBacktrace(ThreadProfile &aProfile, TickSample* aSample)
 {
   void *pc_array[1000];