Bug 1572613 - Use frame pointer based stack walker even if Android/x86 and Android/x86-64. r=jseward
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Tue, 13 Aug 2019 07:34:29 +0000
changeset 488171 05a7f106aada858b64772765a7c180ed06e36e27
parent 488170 f5cc355f51aa846cbb998b5d49bafc2ead3bfa53
child 488172 15849d06fab7a070e56badc4664fb945313f0ed9
push id113904
push userncsoregi@mozilla.com
push dateThu, 15 Aug 2019 19:41:00 +0000
treeherdermozilla-inbound@b283a7ef186c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjseward
bugs1572613
milestone70.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 1572613 - Use frame pointer based stack walker even if Android/x86 and Android/x86-64. r=jseward Actually, we use clang for all Linux and Android platform, so it is no reason to use frame pointer based stack walker for LUL on Android/x86 and Android/x86-64 if no DWARF rule. Differential Revision: https://phabricator.services.mozilla.com/D41320
mozglue/baseprofiler/lul/LulMain.cpp
tools/profiler/lul/LulMain.cpp
--- a/mozglue/baseprofiler/lul/LulMain.cpp
+++ b/mozglue/baseprofiler/lul/LulMain.cpp
@@ -1408,17 +1408,18 @@ void LUL::Unwind(/*OUT*/ uintptr_t* aFra
         mLog("\n");
       }
       // Use the RuleSet to compute the registers for the previous
       // frame.  |regs| is modified in-place.
       UseRuleSet(&regs, aStackImg, ruleset, pfxinstrs);
       continue;
     }
 
-#  if defined(GP_PLAT_amd64_linux) || defined(GP_PLAT_x86_linux)
+#  if defined(GP_PLAT_amd64_linux) || defined(GP_PLAT_x86_linux) || \
+      defined(GP_PLAT_amd64_android) || defined(GP_PLAT_x86_android)
     // There's no RuleSet for the specified address.  On amd64/x86_linux, see if
     // it's possible to recover the caller's frame by using the frame pointer.
 
     // We seek to compute (new_IP, new_SP, new_BP) from (old_BP, stack image),
     // and assume the following layout:
     //
     //                 <--- new_SP
     //   +----------+
@@ -1518,17 +1519,18 @@ void LUL::Unwind(/*OUT*/ uintptr_t* aFra
           // register, and there is no regular rule to compute previous sp
           // register. So mark as invalid.
           regs.sp = TaggedUWord();
           (*aFramePointerFramesAcquired)++;
           continue;
         }
       }
     }
-#  endif  // defined(GP_PLAT_amd64_linux) || defined(GP_PLAT_x86_linux)
+#  endif  // defined(GP_PLAT_amd64_linux) || defined(GP_PLAT_x86_linux) ||
+          // defined(GP_PLAT_amd64_android) || defined(GP_PLAT_x86_android)
 
     // We failed to recover a frame either using CFI or FP chasing, and we
     // have no other ways to recover the frame.  So we have to give up.
     break;
 
   }  // top level unwind loop
 
   // END UNWIND
--- a/tools/profiler/lul/LulMain.cpp
+++ b/tools/profiler/lul/LulMain.cpp
@@ -1403,17 +1403,18 @@ void LUL::Unwind(/*OUT*/ uintptr_t* aFra
         mLog("\n");
       }
       // Use the RuleSet to compute the registers for the previous
       // frame.  |regs| is modified in-place.
       UseRuleSet(&regs, aStackImg, ruleset, pfxinstrs);
       continue;
     }
 
-#if defined(GP_PLAT_amd64_linux) || defined(GP_PLAT_x86_linux)
+#if defined(GP_PLAT_amd64_linux) || defined(GP_PLAT_x86_linux) || \
+    defined(GP_PLAT_amd64_android) || defined(GP_PLAT_x86_android)
     // There's no RuleSet for the specified address.  On amd64/x86_linux, see if
     // it's possible to recover the caller's frame by using the frame pointer.
 
     // We seek to compute (new_IP, new_SP, new_BP) from (old_BP, stack image),
     // and assume the following layout:
     //
     //                 <--- new_SP
     //   +----------+
@@ -1513,17 +1514,18 @@ void LUL::Unwind(/*OUT*/ uintptr_t* aFra
           // register, and there is no regular rule to compute previous sp
           // register. So mark as invalid.
           regs.sp = TaggedUWord();
           (*aFramePointerFramesAcquired)++;
           continue;
         }
       }
     }
-#endif  // defined(GP_PLAT_amd64_linux) || defined(GP_PLAT_x86_linux)
+#endif  // defined(GP_PLAT_amd64_linux) || defined(GP_PLAT_x86_linux) ||
+        // defined(GP_PLAT_amd64_android) || defined(GP_PLAT_x86_android)
 
     // We failed to recover a frame either using CFI or FP chasing, and we
     // have no other ways to recover the frame.  So we have to give up.
     break;
 
   }  // top level unwind loop
 
   // END UNWIND