Bug 880158 - Remove glibc backtrace() native unwind on Linux. r=bgirard.
authorJulian Seward <jseward@acm.org>
Thu, 08 Aug 2013 18:48:20 +0200
changeset 141858 80c3c00e0b3c087fc2b0ce81c50fe898b5d240ca
parent 141857 105f90f2e28ba2fd62e674562f24fb929f7d70ce
child 141859 90943a435604cedd8d1ef75ee545283d3dff7ec8
push id32256
push userjseward@mozilla.com
push dateFri, 09 Aug 2013 08:34:51 +0000
treeherdermozilla-inbound@80c3c00e0b3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgirard
bugs880158
milestone26.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 880158 - Remove glibc backtrace() native unwind on Linux. r=bgirard.
tools/profiler/TableTicker.cpp
--- a/tools/profiler/TableTicker.cpp
+++ b/tools/profiler/TableTicker.cpp
@@ -37,26 +37,16 @@
 
 #if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
   #include "AndroidBridge.h"
 #endif
 
 // JS
 #include "jsdbgapi.h"
 
-// we eventually want to make this runtime switchable
-#if defined(MOZ_PROFILING) && (defined(XP_UNIX) && !defined(XP_MACOSX))
- #ifndef ANDROID
-  #define USE_BACKTRACE
- #endif
-#endif
-#ifdef USE_BACKTRACE
- #include <execinfo.h>
-#endif
-
 #if defined(MOZ_PROFILING) && (defined(XP_MACOSX) || defined(XP_WIN))
  #define USE_NS_STACKWALK
 #endif
 #ifdef USE_NS_STACKWALK
  #include "nsStackWalk.h"
 #endif
 
 using std::string;
@@ -342,32 +332,16 @@ void addProfileEntry(volatile StackEntry
     aProfile.addTag(ProfileEntry('c', sampleLabel));
     lineno = entry.line();
   }
   if (lineno != -1) {
     aProfile.addTag(ProfileEntry('n', lineno));
   }
 }
 
-#ifdef USE_BACKTRACE
-void TableTicker::doNativeBacktrace(ThreadProfile &aProfile, TickSample* aSample)
-{
-  void *array[100];
-  int count = backtrace (array, 100);
-
-  aProfile.addTag(ProfileEntry('s', "(root)"));
-
-  for (int i = 0; i < count; i++) {
-    if( (intptr_t)array[i] == -1 ) break;
-    aProfile.addTag(ProfileEntry('l', (void*)array[i]));
-  }
-}
-#endif
-
-
 #ifdef USE_NS_STACKWALK
 typedef struct {
   void** array;
   void** sp_array;
   size_t size;
   size_t count;
 } PCArray;
 
@@ -517,17 +491,17 @@ void TableTicker::InplaceTick(TickSample
     if (!sLastTracerEvent.IsNull()) {
       TimeDuration delta = sample->timestamp - sLastTracerEvent;
       if (delta.ToMilliseconds() > 100.0) {
           recordSample = true;
       }
     }
   }
 
-#if defined(USE_BACKTRACE) || defined(USE_NS_STACKWALK)
+#if defined(USE_NS_STACKWALK)
   if (mUseStackWalk) {
     doNativeBacktrace(currThreadProfile, sample);
   } else {
     doSampleStackTrace(stack, currThreadProfile, mAddLeafAddresses ? sample : nullptr);
   }
 #else
   doSampleStackTrace(stack, currThreadProfile, mAddLeafAddresses ? sample : nullptr);
 #endif