Bug 717769 - Fix Built-in Profiler on Linux r=ehsan
authorBenoit Girard <b56girard@gmail.com>
Thu, 12 Jan 2012 17:41:58 -0500
changeset 85599 2cc49e58c516767e28ab2831f279a45b93d4976c
parent 85598 d41fbe45000018a326fdb4f4f38153394be589a9
child 85600 3db72233e5d92532b6883f14d3ec8d3e2b7909af
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs717769
milestone12.0a1
Bug 717769 - Fix Built-in Profiler on Linux r=ehsan
tools/profiler/sampler.h
tools/profiler/sps/TableTicker.cpp
--- a/tools/profiler/sampler.h
+++ b/tools/profiler/sampler.h
@@ -81,17 +81,17 @@
 #define FULLFUNCTION __FUNCSIG__
 #elif (__GNUC__ >= 4)
 #define FULLFUNCTION __PRETTY_FUNCTION__
 #else
 #define FULLFUNCTION __FUNCTION__
 #endif
 
 // Redefine the macros for platforms where SPS is supported.
-#if defined(ANDROID) || defined(XP_LINUX) || defined(XP_MACOSX) || defined(XP_WIN)
+#if defined(ANDROID) || defined(XP_UNIX) || defined(XP_MACOSX) || defined(XP_WIN)
 
 #include "sps_sampler.h"
 
 #else
 
 // Initialize the sampler. Any other calls will be silently discarded
 // before the sampler has been initialized (i.e. early start-up code)
 #define SAMPLER_INIT()
--- a/tools/profiler/sps/TableTicker.cpp
+++ b/tools/profiler/sps/TableTicker.cpp
@@ -380,17 +380,17 @@ void TableTicker::Tick(TickSample* sampl
   mStack->mQueueClearMarker = true;
 
 #ifdef USE_BACKTRACE
   doBacktrace(mProfile);
 #else
   doSampleStackTrace(mStack, mProfile, sample);
 #endif
 
-  if (!sLastTracerEvent.IsNull()) {
+  if (!sLastTracerEvent.IsNull() && sample) {
     TimeDuration delta = sample->timestamp - sLastTracerEvent;
     mProfile.addTag(ProfileEntry('r', delta.ToMilliseconds()));
   }
 }
 
 string ProfileEntry::TagToString(Profile *profile)
 {
   string tag = "";