Bug 1367654 (part 2) - In GeckoProfiler.h, rename Sampler* as Profiler*. r=mstange.
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 26 May 2017 14:54:33 +1000
changeset 409580 343d001b8dfe9746d5423d0d1fca61c248805cc9
parent 409579 7b82e5e570d6e28138167115fe74a2d5d32c9e07
child 409581 735a87a03948ba9462017b37f64fed601444c7cd
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1367654
milestone55.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 1367654 (part 2) - In GeckoProfiler.h, rename Sampler* as Profiler*. r=mstange. Because everything else in this file is called ProfilerFoo or PROFILER_FOO.
dom/base/nsJSUtils.cpp
dom/base/nsJSUtils.h
tools/profiler/public/GeckoProfiler.h
tools/profiler/tests/gtest/GeckoProfiler.cpp
--- a/dom/base/nsJSUtils.cpp
+++ b/dom/base/nsJSUtils.cpp
@@ -131,18 +131,18 @@ EvaluationExceptionToNSResult(JSContext*
   }
   return NS_SUCCESS_DOM_SCRIPT_EVALUATION_THREW_UNCATCHABLE;
 }
 
 nsJSUtils::ExecutionContext::ExecutionContext(JSContext* aCx,
                                               JS::Handle<JSObject*> aGlobal)
   :
 #ifdef MOZ_GECKO_PROFILER
-    mSamplerRAII("nsJSUtils::ExecutionContext", /* PROFILER_LABEL */
-                 js::ProfileEntry::Category::JS, __LINE__),
+    mProfilerRAII("nsJSUtils::ExecutionContext", /* PROFILER_LABEL */
+                  js::ProfileEntry::Category::JS, __LINE__),
 #endif
     mCx(aCx)
   , mCompartment(aCx, aGlobal)
   , mRetValue(aCx)
   , mScopeChain(aCx)
   , mRv(NS_OK)
   , mSkip(false)
   , mCoerceToString(false)
--- a/dom/base/nsJSUtils.h
+++ b/dom/base/nsJSUtils.h
@@ -65,17 +65,17 @@ public:
                                   const nsAString& aBody,
                                   JSObject** aFunctionObject);
 
 
   // ExecutionContext is used to switch compartment.
   class MOZ_STACK_CLASS ExecutionContext {
 #ifdef MOZ_GECKO_PROFILER
     // Register stack annotations for the Gecko profiler.
-    mozilla::SamplerStackFrameRAII mSamplerRAII;
+    mozilla::ProfilerStackFrameRAII mProfilerRAII;
 #endif
 
     JSContext* mCx;
 
     // Handles switching to our global's compartment.
     JSAutoCompartment mCompartment;
 
     // Set to a valid handle if a return value is expected.
--- a/tools/profiler/public/GeckoProfiler.h
+++ b/tools/profiler/public/GeckoProfiler.h
@@ -122,31 +122,31 @@ using UniqueProfilerBacktrace =
 #define PROFILER_FUNC(decl, rv)  decl;
 #define PROFILER_FUNC_VOID(decl) void decl;
 
 // 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 PROFILER_LABEL(name_space, info, category) \
   PROFILER_PLATFORM_TRACING(name_space "::" info) \
-  mozilla::SamplerStackFrameRAII \
-  PROFILER_APPEND_LINE_NUMBER(sampler_raii)(name_space "::" info, category, \
-                                            __LINE__)
+  mozilla::ProfilerStackFrameRAII \
+  PROFILER_APPEND_LINE_NUMBER(profiler_raii)(name_space "::" info, category, \
+                                             __LINE__)
 
 #define PROFILER_LABEL_FUNC(category) \
   PROFILER_PLATFORM_TRACING(PROFILER_FUNCTION_NAME) \
-  mozilla::SamplerStackFrameRAII \
-  PROFILER_APPEND_LINE_NUMBER(sampler_raii)(PROFILER_FUNCTION_NAME, category, \
-                                            __LINE__)
+  mozilla::ProfilerStackFrameRAII \
+  PROFILER_APPEND_LINE_NUMBER(profiler_raii)(PROFILER_FUNCTION_NAME, category, \
+                                             __LINE__)
 
 #define PROFILER_LABEL_DYNAMIC(name_space, info, category, str) \
   PROFILER_PLATFORM_TRACING(name_space "::" info) \
-  mozilla::SamplerStackFrameDynamicRAII \
-  PROFILER_APPEND_LINE_NUMBER(sampler_raii)(name_space "::" info, category, \
-                                            __LINE__, str)
+  mozilla::ProfilerStackFrameDynamicRAII \
+  PROFILER_APPEND_LINE_NUMBER(profiler_raii)(name_space "::" info, category, \
+                                             __LINE__, str)
 
 #define PROFILER_MARKER(info) profiler_add_marker(info)
 #define PROFILER_MARKER_PAYLOAD(info, payload) \
   profiler_add_marker(info, payload)
 
 #endif  // defined(MOZ_GECKO_PROFILER)
 
 // Higher-order macro containing all the feature info in one place. Define
@@ -405,17 +405,17 @@ class ProfilerMarkerPayload;
 // definition in platform.cpp for details.
 extern MOZ_THREAD_LOCAL(PseudoStack*) sPseudoStack;
 
 // Returns a handle to pass on exit. This can check that we are popping the
 // correct callstack. Operates the same whether the profiler is active or not.
 //
 // A short-lived, non-owning PseudoStack reference is created between each
 // profiler_call_enter() / profiler_call_exit() call pair. RAII objects (e.g.
-// SamplerStackFrameRAII) ensure that these calls are balanced. Furthermore,
+// ProfilerStackFrameRAII) ensure that these calls are balanced. Furthermore,
 // the RAII objects exist within the thread itself, which means they are
 // necessarily bounded by the lifetime of the thread, which ensures that the
 // references held can't be used after the PseudoStack is destroyed.
 inline void*
 profiler_call_enter(const char* aLabel, js::ProfileEntry::Category aCategory,
                     void* aFrameAddress, uint32_t aLine,
                     const char* aDynamicString = nullptr)
 {
@@ -497,46 +497,46 @@ void profiler_add_marker(const char *aMa
 // In the case of profiler_get_backtrace we know that we only need enough space
 // for a single backtrace.
 #define PROFILER_GET_BACKTRACE_ENTRIES 1000
 
 #define PROFILER_DEFAULT_INTERVAL 1
 
 namespace mozilla {
 
-class MOZ_RAII SamplerStackFrameRAII {
+class MOZ_RAII ProfilerStackFrameRAII {
 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,
+  ProfilerStackFrameRAII(const char *aInfo,
     js::ProfileEntry::Category aCategory, uint32_t line
     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
     mHandle = profiler_call_enter(aInfo, aCategory, this, line);
   }
-  ~SamplerStackFrameRAII() {
+  ~ProfilerStackFrameRAII() {
     profiler_call_exit(mHandle);
   }
 private:
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
   void* mHandle;
 };
 
-class MOZ_RAII SamplerStackFrameDynamicRAII {
+class MOZ_RAII ProfilerStackFrameDynamicRAII {
 public:
-  SamplerStackFrameDynamicRAII(const char* aInfo,
+  ProfilerStackFrameDynamicRAII(const char* aInfo,
     js::ProfileEntry::Category aCategory, uint32_t aLine,
     const char* aDynamicString)
   {
     mHandle = profiler_call_enter(aInfo, aCategory, this, aLine,
                                   aDynamicString);
   }
 
-  ~SamplerStackFrameDynamicRAII() {
+  ~ProfilerStackFrameDynamicRAII() {
     profiler_call_exit(mHandle);
   }
 
 private:
   void* mHandle;
 };
 
 } // namespace mozilla
--- a/tools/profiler/tests/gtest/GeckoProfiler.cpp
+++ b/tools/profiler/tests/gtest/GeckoProfiler.cpp
@@ -367,19 +367,19 @@ TEST(GeckoProfiler, PseudoStack)
 
     profiler_start(PROFILER_DEFAULT_ENTRIES, PROFILER_DEFAULT_INTERVAL,
                    features, filters, MOZ_ARRAY_LENGTH(filters));
 
     ASSERT_TRUE(profiler_get_backtrace());
   }
 
 #if defined(MOZ_GECKO_PROFILER)
-  SamplerStackFrameRAII raii1("A", js::ProfileEntry::Category::STORAGE, 888);
-  SamplerStackFrameDynamicRAII raii2("A", js::ProfileEntry::Category::STORAGE,
-                                     888, dynamic.get());
+  ProfilerStackFrameRAII raii1("A", js::ProfileEntry::Category::STORAGE, 888);
+  ProfilerStackFrameDynamicRAII raii2("A", js::ProfileEntry::Category::STORAGE,
+                                      888, dynamic.get());
   void* handle = profiler_call_enter("A", js::ProfileEntry::Category::NETWORK,
                                      this, 999);
   ASSERT_TRUE(profiler_get_backtrace());
   profiler_call_exit(handle);
 
   profiler_call_exit(nullptr);  // a no-op
 #endif