Bug 1329467 - Drop non-SPS version of AutoProfilerRegister. r=mstange
authorJan Beich <jbeich@FreeBSD.org>
Mon, 09 Jan 2017 23:03:22 +0000
changeset 374279 c5d6b1d405a842548bfbbf8539bc245c59f28780
parent 374278 7b26a0681fcab0a40cf8b58471a3404905e8e96d
child 374280 7a58564c456ace2bb8b7d2cca240921db8b4e51d
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)
reviewersmstange
bugs1329467
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 1329467 - Drop non-SPS version of AutoProfilerRegister. r=mstange MozReview-Commit-ID: 9lZLPAi5ZZT
tools/profiler/public/GeckoProfiler.h
tools/profiler/public/GeckoProfilerImpl.h
--- a/tools/profiler/public/GeckoProfiler.h
+++ b/tools/profiler/public/GeckoProfiler.h
@@ -243,29 +243,16 @@ static inline void profiler_js_operation
 static inline double profiler_time() { return 0; }
 static inline double profiler_time(const mozilla::TimeStamp& aTime) { return 0; }
 
 static inline bool profiler_in_privacy_mode() { return false; }
 
 static inline void profiler_log(const char *str) {}
 static inline void profiler_log(const char *fmt, va_list args) {}
 
-namespace mozilla {
-
-class AutoProfilerRegister final MOZ_STACK_CLASS
-{
-public:
-  explicit AutoProfilerRegister(const char* aName) {}
-private:
-  AutoProfilerRegister(const AutoProfilerRegister&) = delete;
-  AutoProfilerRegister& operator=(const AutoProfilerRegister&) = delete;
-};
-
-} // namespace mozilla
-
 #else
 
 #include "GeckoProfilerImpl.h"
 
 #endif
 
 namespace mozilla {
 
@@ -338,11 +325,31 @@ public:
   }
 
 protected:
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
   const char* mCategory;
   const char* mInfo;
 };
 
+/**
+ * Convenience class to register and unregister a thread with the profiler.
+ * Needs to be the first object on the stack of the thread.
+ */
+class MOZ_STACK_CLASS AutoProfilerRegister final
+{
+public:
+  explicit AutoProfilerRegister(const char* aName)
+  {
+    profiler_register_thread(aName, this);
+  }
+  ~AutoProfilerRegister()
+  {
+    profiler_unregister_thread();
+  }
+private:
+  AutoProfilerRegister(const AutoProfilerRegister&) = delete;
+  AutoProfilerRegister& operator=(const AutoProfilerRegister&) = delete;
+};
+
 } // namespace mozilla
 
 #endif // ifndef SAMPLER_H
--- a/tools/profiler/public/GeckoProfilerImpl.h
+++ b/tools/profiler/public/GeckoProfilerImpl.h
@@ -427,36 +427,16 @@ public:
   ~SamplerStackFramePrintfRAII() {
     mozilla_sampler_call_exit(mHandle);
   }
 private:
   char mDest[SAMPLER_MAX_STRING];
   void* mHandle;
 };
 
-/**
- * Convenience class to register and unregister a thread with the profiler.
- * Needs to be the first object on the stack of the thread.
- */
-class MOZ_STACK_CLASS AutoProfilerRegister final
-{
-public:
-  explicit AutoProfilerRegister(const char* aName)
-  {
-    profiler_register_thread(aName, this);
-  }
-  ~AutoProfilerRegister()
-  {
-    profiler_unregister_thread();
-  }
-private:
-  AutoProfilerRegister(const AutoProfilerRegister&) = delete;
-  AutoProfilerRegister& operator=(const AutoProfilerRegister&) = delete;
-};
-
 } // namespace mozilla
 
 inline PseudoStack* mozilla_get_pseudo_stack(void)
 {
   if (!stack_key_initialized)
     return nullptr;
   return tlsPseudoStack.get();
 }