Backed out changeset 77f321ed3d9e (bug 851611) for breaking the build; CLOSED TREE
authorEd Morley <emorley@mozilla.com>
Mon, 18 Mar 2013 14:11:07 +0000
changeset 125232 e23e43a2c14e051ec59b4b186cf2946ce2c1ee58
parent 125231 1bed4fd2b0fa4f67407ee191e37318e83e04eecb
child 125233 f029edccac09f362c5b304c6cd61cd3261b4737c
push id24822
push useremorley@mozilla.com
push dateMon, 18 Mar 2013 14:11:17 +0000
treeherdermozilla-inbound@e23e43a2c14e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs851611
milestone22.0a1
backs out77f321ed3d9ea312274c42452169c3954807f027
first release with
nightly linux32
e23e43a2c14e / 22.0a1 / 20130319030939 / files
nightly linux64
e23e43a2c14e / 22.0a1 / 20130319030939 / files
nightly mac
e23e43a2c14e / 22.0a1 / 20130319030939 / files
nightly win32
e23e43a2c14e / 22.0a1 / 20130319030939 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Backed out changeset 77f321ed3d9e (bug 851611) for breaking the build; CLOSED TREE
tools/profiler/TableTicker.cpp
tools/profiler/sampler.h
tools/profiler/sps_sampler.h
--- a/tools/profiler/TableTicker.cpp
+++ b/tools/profiler/TableTicker.cpp
@@ -1218,17 +1218,17 @@ bool mozilla_sampler_is_active1()
     return false;
   }
 
   return t->IsActive();
 }
 
 static double sResponsivenessTimes[100];
 static unsigned int sResponsivenessLoc = 0;
-void mozilla_sampler_responsiveness1(const TimeStamp& aTime)
+void mozilla_sampler_responsiveness1(TimeStamp aTime)
 {
   if (!sLastTracerEvent.IsNull()) {
     if (sResponsivenessLoc == 100) {
       for(size_t i = 0; i < 100-1; i++) {
         sResponsivenessTimes[i] = sResponsivenessTimes[i+1];
       }
       sResponsivenessLoc--;
     }
--- a/tools/profiler/sampler.h
+++ b/tools/profiler/sampler.h
@@ -44,101 +44,48 @@
  *          application is responding to the event loop. Lower is better.
  * 't' - Elapse time since recording started.
  *
  */
 
 #ifndef SAMPLER_H
 #define SAMPLER_H
 
-#include "jsfriendapi.h"
-#include "mozilla/NullPtr.h"
-#include "mozilla/TimeStamp.h"
-
-#ifndef MOZ_ENABLE_PROFILER_SPS
-
-// Insert a RAII in this scope to active a pseudo label. Any samples collected
-// in this scope will contain this annotation. For dynamic strings use
-// PROFILER_LABEL_PRINTF. Arguments must be string literals.
-#define PROFILER_LABEL(name_space, info) do {} while (0)
-
-// Format a dynamic string as a pseudo label. These labels will a considerable
-// storage size in the circular buffer compared to regular labels. This function
-// can be used to annotate custom information such as URL for the resource being
-// decoded or the size of the paint.
-#define PROFILER_LABEL_PRINTF(name_space, info, format, ...) do {} while (0)
-
-// Insert a marker in the profile timeline. This is useful to delimit something
-// important happening such as the first paint. Unlike profiler_label that are
-// only recorded if a sample is collected while it is active, marker will always
-// be collected.
-#define PROFILER_MARKER(info) do {} while (0)
-
-// Main thread specilization to avoid TLS lookup for performance critical use.
-#define PROFILER_MAIN_THREAD_LABEL(name_space, info) do {} while (0)
-#define PROFILER_MAIN_THREAD_LABEL_PRINTF(name_space, info, format, ...) do {} while (0)
-
-// Initilize the profiler TLS, signal handlers on linux. If MOZ_PROFILER_STARTUP
-// is set the profiler will be started. This call must happen before any other
-// sampler calls. Particularly sampler_label/sampler_marker.
-static inline void profiler_init() {};
-
-// Clean up the profiler module, stopping it if required. This function may
-// also save a shutdown profile if requested. No profiler calls should happen
-// after this point and all pseudo labels should have been popped.
-static inline void profiler_shutdown() {};
+// Redefine the macros for platforms where SPS is supported.
+#ifdef MOZ_ENABLE_PROFILER_SPS
 
-// Start the profiler with the selected options. The samples will be
-// recorded in a circular buffer.
-//   "aProfileEntries" is an abstract size indication of how big
-//       the profile's circular buffer should be. Multiply by 4
-//       words to get the cost.
-//   "aInterval" the sampling interval. The profiler will do its
-//       best to sample at this interval. The profiler visualization
-//       should represent the actual sampling accuracy.
-static inline void profiler_start(int aProfileEntries, int aInterval,
-                              const char** aFeatures, uint32_t aFeatureCount) {}
-
-// Stop the profiler and discard the profile. Call 'profiler_save' before this
-// to retrieve the profile.
-static inline void profiler_stop() {}
-
-static inline bool profiler_is_active() { return false; }
-
-// Internal-only. Used by the event tracer.
-static inline void profiler_responsinveness(const TimeStamp& aTime) {}
-
-// Internal-only. Used by the event tracer.
-static inline double* profiler_get_responsiveness() { return nullptr; }
-
-// Internal-only.
-static inline void profile_set_frame_number(int frameNumber) {}
-
-// Get the profile encoded as a JSON string.
-static inline char* profiler_get_profile() { return nullptr; }
-
-// Get the profile encoded as a JSON object.
-static inline JSObject* profiler_get_profile_object() { return nullptr; }
-
-// Get the features supported by the profiler that are accepted by profiler_init.
-// Returns a null terminated char* array.
-static inline char** profiler_get_features() { return nullptr; }
-
-// Print the current location to the console. This functill will do it best effort
-// to show the profiler's combined js/c++ if the profiler is running. Note that
-// printing the location require symbolicating which is very slow.
-static inline void profiler_print_location() {}
-
-// Discard the profile, throw away the profile and notify 'profiler-locked'.
-// This function is to be used when entering private browsing to prevent
-// the profiler from collecting sensitive data.
-static inline void profiler_lock() {}
-
-// Re-enable the profiler and notify 'profiler-unlocked'.
-static inline void profiler_unlock() {}
+#include "sps_sampler.h"
 
 #else
 
-#include "sps_sampler.h"
+// 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()
+#define SAMPLER_SHUTDOWN()
+#define SAMPLER_START(entries, interval, features, featureCount)
+#define SAMPLER_STOP()
+#define SAMPLER_IS_ACTIVE() false
+#define SAMPLER_SAVE()
+// Returned string must be free'ed
+#define SAMPLER_GET_PROFILE() NULL
+#define SAMPLER_GET_PROFILE_DATA(ctx) NULL
+#define SAMPLER_RESPONSIVENESS(time) NULL
+#define SAMPLER_FRAME_NUMBER(frameNumber)
+#define SAMPLER_GET_RESPONSIVENESS() NULL
+#define SAMPLER_GET_FEATURES() NULL
+#define SAMPLE_LABEL(name_space, info)
+// Provide a default literal string to use if profiling is disabled
+// and a printf argument to be computed if profiling is enabled.
+// NOTE: This will store the formated string on the stack and consume
+//       over 128 bytes on the stack.
+#define SAMPLE_LABEL_PRINTF(name_space, info, format, ...)
+#define SAMPLE_LABEL_FN(name_space, info)
+#define SAMPLE_MARKER(info)
+#define SAMPLE_MAIN_THREAD_LABEL_PRINTF(name_space, info, format, ...)
+#define SAMPLE_MAIN_THREAD_LABEL_FN(name_space, info)
+#define SAMPLE_MAIN_THREAD_MARKER(info)
+
+// Tracing features
+#define SAMPLER_PRINT_LOCATION()
 
 #endif
 
 #endif // ifndef SAMPLER_H
--- a/tools/profiler/sps_sampler.h
+++ b/tools/profiler/sps_sampler.h
@@ -41,221 +41,114 @@ extern bool stack_key_initialized;
 #  define SAMPLE_FUNCTION_NAME __FUNCTION__
 # elif defined(_MSC_VER)
 #  define SAMPLE_FUNCTION_NAME __FUNCTION__
 # else
 #  define SAMPLE_FUNCTION_NAME __func__  // defined in C99, supported in various C++ compilers. Just raw function name.
 # endif
 #endif
 
-// Returns a handle to pass on exit. This can check that we are popping the
-// correct callstack.
-inline void* mozilla_sampler_call_enter(const char *aInfo, void *aFrameAddress = NULL,
-                                        bool aCopy = false, uint32_t line = 0);
-inline void  mozilla_sampler_call_exit(void* handle);
-inline void  mozilla_sampler_add_marker(const char *aInfo);
-
-void mozilla_sampler_start1(int aEntries, int aInterval, const char** aFeatures,
-                            uint32_t aFeatureCount);
-void mozilla_sampler_start2(int aEntries, int aInterval, const char** aFeatures,
-                            uint32_t aFeatureCount);
-
-void mozilla_sampler_stop1();
-void mozilla_sampler_stop2();
-
-bool mozilla_sampler_is_active1();
-bool mozilla_sampler_is_active2();
-
-void mozilla_sampler_responsiveness1(TimeStamp time);
-void mozilla_sampler_responsiveness2(TimeStamp time);
-
-void mozilla_sampler_frame_number1(int frameNumber);
-void mozilla_sampler_frame_number2(int frameNumber);
-
-const double* mozilla_sampler_get_responsiveness1();
-const double* mozilla_sampler_get_responsiveness2();
-
-void mozilla_sampler_save1();
-void mozilla_sampler_save2();
-
-char* mozilla_sampler_get_profile1();
-char* mozilla_sampler_get_profile2();
-
-JSObject *mozilla_sampler_get_profile_data1(JSContext *aCx);
-JSObject *mozilla_sampler_get_profile_data2(JSContext *aCx);
-
-const char** mozilla_sampler_get_features1();
-const char** mozilla_sampler_get_features2();
-
-void mozilla_sampler_init1();
-void mozilla_sampler_init2();
-
-void mozilla_sampler_shutdown1();
-void mozilla_sampler_shutdown2();
-
-void mozilla_sampler_print_location1();
-void mozilla_sampler_print_location2();
-
-// Lock the profiler. When locked the profiler is (1) stopped,
-// (2) profile data is cleared, (3) profiler-locked is fired.
-// This is used to lock down the profiler during private browsing
-void mozilla_sampler_lock1();
-void mozilla_sampler_lock2();
-
-// Unlock the profiler, leaving it stopped and fires profiler-unlocked.
-void mozilla_sampler_unlock1();
-void mozilla_sampler_unlock2();
-
 /* Returns true if env var SPS_NEW is set to anything, else false. */
 extern bool sps_version2();
 
-static inline
-void profiler_init()
-{
-  if (!sps_version2()) {
-    mozilla_sampler_init1();
-  } else {
-    mozilla_sampler_init2();
-  }
-}
+#define SAMPLER_INIT() \
+  do { \
+    if (!sps_version2()) mozilla_sampler_init1(); \
+                    else mozilla_sampler_init2(); \
+  } while (0)
 
-static inline
-void profiler_shutdown()
-{
-  if (!sps_version2()) {
-    mozilla_sampler_shutdown1();
-  } else {
-    mozilla_sampler_shutdown2();
-  }
-}
+#define SAMPLER_SHUTDOWN() \
+  do { \
+    if (!sps_version2()) mozilla_sampler_shutdown1(); \
+                    else mozilla_sampler_shutdown2(); \
+  } while (0)
 
-static inline
-void profiler_start(int aProfileEntries, int aInterval,
-                       const char** aFeatures, uint32_t aFeatureCount)
-{
-  if (!sps_version2()) {
-    mozilla_sampler_start1(aProfileEntries, aInterval, aFeatures, aFeatureCount);
-  } else {
-    mozilla_sampler_start2(aProfileEntries, aInterval, aFeatures, aFeatureCount);
-  }
-}
+#define SAMPLER_START(entries, interval, features, featureCount) \
+  do { \
+    if (!sps_version2()) \
+      mozilla_sampler_start1(entries, interval, features, featureCount); \
+    else \
+      mozilla_sampler_start2(entries, interval, features, featureCount); \
+  } while (0)
 
-static inline
-void profiler_stop()
-{
-  if (!sps_version2()) {
-    mozilla_sampler_stop1();
-  } else {
-    mozilla_sampler_stop2();
-  }
-}
+#define SAMPLER_STOP() \
+  do { \
+    if (!sps_version2()) mozilla_sampler_stop1(); \
+                    else mozilla_sampler_stop2(); \
+  } while (0)
 
-static inline
-bool profiler_is_active()
-{
-  if (!sps_version2()) {
-    return mozilla_sampler_is_active1();
-  } else {
-    return mozilla_sampler_is_active2();
-  }
-}
-
-static inline
-void profiler_responsiveness(const TimeStamp& aTime)
-{
-  if (!sps_version2()) {
-    mozilla_sampler_responsiveness1(aTime);
-  } else {
-    mozilla_sampler_responsiveness2(aTime);
-  }
-}
+#define SAMPLER_IS_ACTIVE() \
+    (!sps_version2() ? mozilla_sampler_is_active1() \
+                     : mozilla_sampler_is_active2() )
 
-static inline
-const double* profiler_get_responsiveness()
-{
-  if (!sps_version2()) {
-    return mozilla_sampler_get_responsiveness1();
-  } else {
-    return mozilla_sampler_get_responsiveness2();
-  }
-}
+#define SAMPLER_RESPONSIVENESS(time) \
+  do { \
+    if (!sps_version2()) mozilla_sampler_responsiveness1(time); \
+                    else mozilla_sampler_responsiveness2(time); \
+  } while (0)
 
-static inline
-void profiler_set_frame_number(int frameNumber)
-{
-  if (!sps_version2()) {
-    return mozilla_sampler_frame_number1(frameNumber);
-  } else {
-    return mozilla_sampler_frame_number2(frameNumber);
-  }
-}
+#define SAMPLER_GET_RESPONSIVENESS() \
+    (!sps_version2() ? mozilla_sampler_get_responsiveness1() \
+                     : mozilla_sampler_get_responsiveness2() )
 
-static inline
-char* profiler_get_profile()
-{
-  if (!sps_version2()) {
-    return mozilla_sampler_get_profile1();
-  } else {
-    return mozilla_sampler_get_profile2();
-  }
-}
+#define SAMPLER_FRAME_NUMBER(frameNumber) \
+  do { \
+    if (!sps_version2()) mozilla_sampler_frame_number1(frameNumber); \
+                    else mozilla_sampler_frame_number2(frameNumber); \
+  } while (0)
 
-static inline
-const char** profiler_get_features()
-{
-  if (!sps_version2()) {
-    return mozilla_sampler_get_features1();
-  } else {
-    return mozilla_sampler_get_features2();
-  }
-}
-
-static inline
-void profiler_print_location()
-{
-  if (!sps_version2()) {
-    return mozilla_sampler_print_location1();
-  } else {
-    return mozilla_sampler_print_location2();
-  }
-}
+#define SAMPLER_SAVE() \
+  do { \
+    if (!sps_version2()) mozilla_sampler_save1(); \
+                    else mozilla_sampler_save2(); \
+  } while (0)
 
-static inline
-void profiler_lock()
-{
-  if (!sps_version2()) {
-    return mozilla_sampler_lock1();
-  } else {
-    return mozilla_sampler_lock2();
-  }
-}
+#define SAMPLER_GET_PROFILE() \
+   (!sps_version2() ? mozilla_sampler_get_profile1() \
+                    : mozilla_sampler_get_profile2() )
 
-static inline
-void profiler_unlock()
-{
-  if (!sps_version2()) {
-    return mozilla_sampler_unlock1();
-  } else {
-    return mozilla_sampler_unlock2();
-  }
-}
+#define SAMPLER_GET_PROFILE_DATA(ctx) \
+   (!sps_version2() ? mozilla_sampler_get_profile_data1(ctx) \
+                    : mozilla_sampler_get_profile_data2(ctx) )
+
+#define SAMPLER_GET_FEATURES() \
+   (!sps_version2() ? mozilla_sampler_get_features1() \
+                    : mozilla_sampler_get_features2() )
 
 // we want the class and function name but can't easily get that using preprocessor macros
 // __func__ doesn't have the class name and __PRETTY_FUNCTION__ has the parameters
 
 #define SAMPLER_APPEND_LINE_NUMBER_PASTE(id, line) id ## line
 #define SAMPLER_APPEND_LINE_NUMBER_EXPAND(id, line) SAMPLER_APPEND_LINE_NUMBER_PASTE(id, line)
 #define SAMPLER_APPEND_LINE_NUMBER(id) SAMPLER_APPEND_LINE_NUMBER_EXPAND(id, __LINE__)
 
-#define PROFILER_LABEL(name_space, info) mozilla::SamplerStackFrameRAII SAMPLER_APPEND_LINE_NUMBER(sampler_raii)(name_space "::" info, __LINE__)
-#define PROFILER_LABEL_PRINTF(name_space, info, ...) mozilla::SamplerStackFramePrintfRAII SAMPLER_APPEND_LINE_NUMBER(sampler_raii)(name_space "::" info, __LINE__, __VA_ARGS__)
-#define PROFILER_MARKER(info) mozilla_sampler_add_marker(info)
-#define PROFILER_MAIN_THREAD_LABEL(name_space, info)  MOZ_ASSERT(NS_IsMainThread(), "This can only be called on the main thread"); mozilla::SamplerStackFrameRAII SAMPLER_APPEND_LINE_NUMBER(sampler_raii)(name_space "::" info, __LINE__)
-#define PROFILER_MAIN_THREAD_LABEL_PRINTF(name_space, info, ...)  MOZ_ASSERT(NS_IsMainThread(), "This can only be called on the main thread"); mozilla::SamplerStackFramePrintfRAII SAMPLER_APPEND_LINE_NUMBER(sampler_raii)(name_space "::" info, __LINE__, __VA_ARGS__)
-#define PROFILER_MAIN_THREAD_MARKER(info)  MOZ_ASSERT(NS_IsMainThread(), "This can only be called on the main thread"); mozilla_sampler_add_marker(info)
+#define SAMPLE_LABEL(name_space, info) mozilla::SamplerStackFrameRAII SAMPLER_APPEND_LINE_NUMBER(sampler_raii)(name_space "::" info, __LINE__)
+#define SAMPLE_LABEL_PRINTF(name_space, info, ...) mozilla::SamplerStackFramePrintfRAII SAMPLER_APPEND_LINE_NUMBER(sampler_raii)(name_space "::" info, __LINE__, __VA_ARGS__)
+#define SAMPLE_MARKER(info) mozilla_sampler_add_marker(info)
+#define SAMPLE_MAIN_THREAD_LABEL(name_space, info)  MOZ_ASSERT(NS_IsMainThread(), "This can only be called on the main thread"); mozilla::SamplerStackFrameRAII SAMPLER_APPEND_LINE_NUMBER(sampler_raii)(name_space "::" info, __LINE__)
+#define SAMPLE_MAIN_THREAD_LABEL_PRINTF(name_space, info, ...)  MOZ_ASSERT(NS_IsMainThread(), "This can only be called on the main thread"); mozilla::SamplerStackFramePrintfRAII SAMPLER_APPEND_LINE_NUMBER(sampler_raii)(name_space "::" info, __LINE__, __VA_ARGS__)
+#define SAMPLE_MAIN_THREAD_MARKER(info)  MOZ_ASSERT(NS_IsMainThread(), "This can only be called on the main thread"); mozilla_sampler_add_marker(info)
+
+#define SAMPLER_PRINT_LOCATION() \
+    do { \
+      if (!sps_version2()) mozilla_sampler_print_location1(); \
+                      else mozilla_sampler_print_location2(); \
+    } while (0)
+
+#define SAMPLER_LOCK() \
+    do { \
+      if (!sps_version2()) mozilla_sampler_lock1(); \
+                      else mozilla_sampler_lock2(); \
+    } while (0)
+
+#define SAMPLER_UNLOCK() \
+    do { \
+      if (!sps_version2()) mozilla_sampler_unlock1(); \
+                      else mozilla_sampler_unlock2(); \
+    } while (0)
 
 /* we duplicate this code here to avoid header dependencies
  * which make it more difficult to include in other places */
 #if defined(_M_X64) || defined(__x86_64__)
 #define V8_HOST_ARCH_X64 1
 #elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
 #define V8_HOST_ARCH_IA32 1
 #elif defined(__ARMEL__)
@@ -340,16 +233,74 @@ LinuxKernelMemoryBarrierFunc pLinuxKerne
 #  define STORE_SEQUENCER() asm volatile("" ::: "memory");
 # else
 #  error "Memory clobber not supported for your compiler."
 # endif
 #else
 # error "Memory clobber not supported for your platform."
 #endif
 
+// Returns a handle to pass on exit. This can check that we are popping the
+// correct callstack.
+inline void* mozilla_sampler_call_enter(const char *aInfo, void *aFrameAddress = NULL,
+                                        bool aCopy = false, uint32_t line = 0);
+inline void  mozilla_sampler_call_exit(void* handle);
+inline void  mozilla_sampler_add_marker(const char *aInfo);
+
+void mozilla_sampler_start1(int aEntries, int aInterval, const char** aFeatures,
+                            uint32_t aFeatureCount);
+void mozilla_sampler_start2(int aEntries, int aInterval, const char** aFeatures,
+                            uint32_t aFeatureCount);
+
+void mozilla_sampler_stop1();
+void mozilla_sampler_stop2();
+
+bool mozilla_sampler_is_active1();
+bool mozilla_sampler_is_active2();
+
+void mozilla_sampler_responsiveness1(TimeStamp time);
+void mozilla_sampler_responsiveness2(TimeStamp time);
+
+void mozilla_sampler_frame_number1(int frameNumber);
+void mozilla_sampler_frame_number2(int frameNumber);
+
+const double* mozilla_sampler_get_responsiveness1();
+const double* mozilla_sampler_get_responsiveness2();
+
+void mozilla_sampler_save1();
+void mozilla_sampler_save2();
+
+char* mozilla_sampler_get_profile1();
+char* mozilla_sampler_get_profile2();
+
+JSObject *mozilla_sampler_get_profile_data1(JSContext *aCx);
+JSObject *mozilla_sampler_get_profile_data2(JSContext *aCx);
+
+const char** mozilla_sampler_get_features1();
+const char** mozilla_sampler_get_features2();
+
+void mozilla_sampler_init1();
+void mozilla_sampler_init2();
+
+void mozilla_sampler_shutdown1();
+void mozilla_sampler_shutdown2();
+
+void mozilla_sampler_print_location1();
+void mozilla_sampler_print_location2();
+
+// Lock the profiler. When locked the profiler is (1) stopped,
+// (2) profile data is cleared, (3) profiler-locked is fired.
+// This is used to lock down the profiler during private browsing
+void mozilla_sampler_lock1();
+void mozilla_sampler_lock2();
+
+// Unlock the profiler, leaving it stopped and fires profiler-unlocked.
+void mozilla_sampler_unlock1();
+void mozilla_sampler_unlock2();
+
 namespace mozilla {
 
 class NS_STACK_CLASS SamplerStackFrameRAII {
 public:
   // we only copy the strings at save time, so to take multiple parameters we'd need to copy them then.
   SamplerStackFrameRAII(const char *aInfo, uint32_t line) {
     mHandle = mozilla_sampler_call_enter(aInfo, this, false, line);
   }
@@ -360,17 +311,17 @@ private:
   void* mHandle;
 };
 
 static const int SAMPLER_MAX_STRING = 128;
 class NS_STACK_CLASS SamplerStackFramePrintfRAII {
 public:
   // we only copy the strings at save time, so to take multiple parameters we'd need to copy them then.
   SamplerStackFramePrintfRAII(const char *aDefault, uint32_t line, const char *aFormat, ...) {
-    if (profiler_is_active()) {
+    if (SAMPLER_IS_ACTIVE()) {
       va_list args;
       va_start(args, aFormat);
       char buff[SAMPLER_MAX_STRING];
 
       // We have to use seperate printf's because we're using
       // the vargs.
 #if _MSC_VER
       _vsnprintf(buff, SAMPLER_MAX_STRING, aFormat, args);
@@ -619,17 +570,17 @@ inline void mozilla_sampler_call_exit(vo
 
 inline void mozilla_sampler_add_marker(const char *aMarker)
 {
   if (!stack_key_initialized)
     return;
 
   // Don't insert a marker if we're not profiling to avoid
   // the heap copy (malloc).
-  if (!profiler_is_active()) {
+  if (!SAMPLER_IS_ACTIVE()) {
     return;
   }
 
   PseudoStack *stack = tlsPseudoStack.get();
   if (!stack) {
     return;
   }
   stack->addMarker(aMarker);