Bug 1347274 (part 1, attempt 2) - Rename some profiler parameters. r=mstange.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 01 Jun 2017 10:21:58 +1000
changeset 361754 85e6c77120d20c57254a722133bd7305e4839307
parent 361753 7c6116ac71e954805dccf3146d6fffcf28bbc0cf
child 361755 9bf2eafa8defa9b0d69bfe8c757ca69826543e9b
push id31940
push usercbook@mozilla.com
push dateThu, 01 Jun 2017 11:51:11 +0000
treeherdermozilla-central@0bcea6bac179 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1347274
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 1347274 (part 1, attempt 2) - Rename some profiler parameters. r=mstange.
tools/profiler/core/ThreadInfo.h
tools/profiler/core/platform.cpp
tools/profiler/public/GeckoProfiler.h
--- a/tools/profiler/core/ThreadInfo.h
+++ b/tools/profiler/core/ThreadInfo.h
@@ -49,20 +49,20 @@ public:
     // If these measurements are added, the code must be careful to avoid data
     // races. (The current code doesn't have any race issues because the
     // contents of the PseudoStack object aren't accessed; |this| is used only
     // as an address for lookup by aMallocSizeof).
 
     return n;
   }
 
-  void AddPendingMarker(const char* aMarkerStr, ProfilerMarkerPayload* aPayload,
-                        double aTime)
+  void AddPendingMarker(const char* aMarkerName,
+                        ProfilerMarkerPayload* aPayload, double aTime)
   {
-    ProfilerMarker* marker = new ProfilerMarker(aMarkerStr, aPayload, aTime);
+    ProfilerMarker* marker = new ProfilerMarker(aMarkerName, aPayload, aTime);
     mPendingMarkers.insert(marker);
   }
 
   // Called within signal. Function must be reentrant.
   ProfilerMarkerLinkedList* GetPendingMarkers()
   {
     // The profiled thread is interrupted, so we can access the list safely.
     // Unless the profiled thread was in the middle of changing the list when
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -2840,17 +2840,17 @@ profiler_get_backtrace_noalloc(char *out
       output += labelLength;
     }
     *output++ = '\0';
     *output = '\0';
   }
 }
 
 static void
-locked_profiler_add_marker(PSLockRef aLock, const char* aMarker,
+locked_profiler_add_marker(PSLockRef aLock, const char* aMarkerName,
                            ProfilerMarkerPayload* aPayload)
 {
   MOZ_RELEASE_ASSERT(CorePS::Exists());
   MOZ_RELEASE_ASSERT(ActivePS::Exists(aLock) &&
                      !ActivePS::FeaturePrivacy(aLock));
 
   // aPayload must be freed if we return early.
   mozilla::UniquePtr<ProfilerMarkerPayload> payload(aPayload);
@@ -2859,67 +2859,68 @@ locked_profiler_add_marker(PSLockRef aLo
   if (!racyInfo) {
     return;
   }
 
   mozilla::TimeStamp origin = (payload && !payload->GetStartTime().IsNull())
                             ? payload->GetStartTime()
                             : mozilla::TimeStamp::Now();
   mozilla::TimeDuration delta = origin - CorePS::ProcessStartTime(aLock);
-  racyInfo->AddPendingMarker(aMarker, payload.release(),
+  racyInfo->AddPendingMarker(aMarkerName, payload.release(),
                              delta.ToMilliseconds());
 }
 
 void
-profiler_add_marker(const char* aMarker, ProfilerMarkerPayload* aPayload)
+profiler_add_marker(const char* aMarkerName, ProfilerMarkerPayload* aPayload)
 {
   MOZ_RELEASE_ASSERT(CorePS::Exists());
 
   PSAutoLock lock(gPSMutex);
 
   // aPayload must be freed if we return early.
   mozilla::UniquePtr<ProfilerMarkerPayload> payload(aPayload);
 
   if (!ActivePS::Exists(lock) || ActivePS::FeaturePrivacy(lock)) {
     return;
   }
 
-  locked_profiler_add_marker(lock, aMarker, payload.release());
+  locked_profiler_add_marker(lock, aMarkerName, payload.release());
 }
 
 void
-profiler_tracing(const char* aCategory, const char* aInfo, TracingKind aKind)
+profiler_tracing(const char* aCategory, const char* aMarkerName,
+                 TracingKind aKind)
 {
   MOZ_RELEASE_ASSERT(CorePS::Exists());
 
   PSAutoLock lock(gPSMutex);
 
   if (!ActivePS::Exists(lock) || ActivePS::FeaturePrivacy(lock)) {
     return;
   }
 
-  auto marker = new ProfilerMarkerTracing(aCategory, aKind);
-  locked_profiler_add_marker(lock, aInfo, marker);
+  auto payload = new ProfilerMarkerTracing(aCategory, aKind);
+  locked_profiler_add_marker(lock, aMarkerName, payload);
 }
 
 void
-profiler_tracing(const char* aCategory, const char* aInfo,
+profiler_tracing(const char* aCategory, const char* aMarkerName,
                  UniqueProfilerBacktrace aCause, TracingKind aKind)
 {
   MOZ_RELEASE_ASSERT(CorePS::Exists());
 
   PSAutoLock lock(gPSMutex);
 
   if (!ActivePS::Exists(lock) || ActivePS::FeaturePrivacy(lock)) {
     return;
   }
 
-  auto marker =
+  auto payload =
     new ProfilerMarkerTracing(aCategory, aKind, mozilla::Move(aCause));
-  locked_profiler_add_marker(lock, aInfo, marker);
+  locked_profiler_add_marker(lock, aMarkerName, payload);
 }
 
 void
 profiler_log(const char* aStr)
 {
   profiler_tracing("log", aStr);
 }
 
--- a/tools/profiler/public/GeckoProfiler.h
+++ b/tools/profiler/public/GeckoProfiler.h
@@ -99,18 +99,18 @@ using UniqueProfilerBacktrace =
 // PROFILER_LABEL frames take up considerably less space in the profile buffer
 // than PROFILER_LABEL_DYNAMIC frames.
 #define PROFILER_LABEL_DYNAMIC(name_space, info, category, str) 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)
-#define PROFILER_MARKER_PAYLOAD(info, payload) \
+#define PROFILER_MARKER(marker_name) do {} while (0)
+#define PROFILER_MARKER_PAYLOAD(marker_name, payload) \
   do { \
     mozilla::UniquePtr<ProfilerMarkerPayload> payloadDeletor(payload); \
   } while (0)
 
 #else   // defined(MOZ_GECKO_PROFILER)
 
 #if defined(__GNUC__) || defined(_MSC_VER)
 # define PROFILER_FUNCTION_NAME __FUNCTION__
@@ -138,19 +138,19 @@ using UniqueProfilerBacktrace =
                                              __LINE__)
 
 #define PROFILER_LABEL_DYNAMIC(name_space, info, category, str) \
   PROFILER_PLATFORM_TRACING(name_space "::" info) \
   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)
+#define PROFILER_MARKER(marker_name) profiler_add_marker(marker_name)
+#define PROFILER_MARKER_PAYLOAD(marker_name, payload) \
+  profiler_add_marker(marker_name, payload)
 
 #endif  // defined(MOZ_GECKO_PROFILER)
 
 // Higher-order macro containing all the feature info in one place. Define
 // |macro| appropriately to extract the relevant parts. Note that the number
 // values are used internally only and so can be changed without consequence.
 #define PROFILER_FOR_EACH_FEATURE(macro) \
   /* Dump the display list with the textures. */ \
@@ -206,19 +206,21 @@ struct ProfilerFeature
 
   #undef DECLARE
 };
 
 // These functions are defined whether the profiler is enabled or not.
 
 // Adds a tracing marker to the PseudoStack. A no-op if the profiler is
 // inactive or in privacy mode.
-PROFILER_FUNC_VOID(profiler_tracing(const char* aCategory, const char* aInfo,
+PROFILER_FUNC_VOID(profiler_tracing(const char* aCategory,
+                                    const char* aMarkerName,
                                     TracingKind aKind = TRACING_EVENT))
-PROFILER_FUNC_VOID(profiler_tracing(const char* aCategory, const char* aInfo,
+PROFILER_FUNC_VOID(profiler_tracing(const char* aCategory,
+                                    const char* aMarkerName,
                                     UniqueProfilerBacktrace aCause,
                                     TracingKind aKind = TRACING_EVENT))
 
 // Initialize the profiler. If MOZ_PROFILER_STARTUP is set the profiler will be
 // started. This call must happen before any other profiler calls (except
 // profiler_start(), which will call profiler_init() if it hasn't already run).
 PROFILER_FUNC_VOID(profiler_init(void* stackTop))
 
@@ -254,18 +256,18 @@ PROFILER_FUNC_VOID(profiler_resume())
 
 // Is the profiler active and paused? Returns false if the profiler is inactive.
 PROFILER_FUNC(bool profiler_is_paused(), false)
 
 // Immediately capture the current thread's call stack and return it. A no-op
 // if the profiler is inactive or in privacy mode.
 PROFILER_FUNC(UniqueProfilerBacktrace profiler_get_backtrace(), nullptr)
 
-PROFILER_FUNC_VOID(profiler_get_backtrace_noalloc(char *output,
-                                                  size_t outputSize))
+PROFILER_FUNC_VOID(profiler_get_backtrace_noalloc(char* aOutput,
+                                                  size_t aOutputSize))
 
 // Free a ProfilerBacktrace returned by profiler_get_backtrace().
 #if !defined(MOZ_GECKO_PROFILER)
 inline void
 ProfilerBacktraceDestructor::operator()(ProfilerBacktrace* aBacktrace) {}
 #endif
 
 // Is the profiler active? Note: the return value of this function can become
@@ -369,17 +371,17 @@ PROFILER_FUNC(bool profiler_thread_is_sl
 // on auxiliary threads. Operates the same whether the profiler is active or
 // not.
 PROFILER_FUNC_VOID(profiler_js_interrupt_callback())
 
 // The number of milliseconds since the process started. Operates the same
 // whether the profiler is active or inactive.
 PROFILER_FUNC(double profiler_time(), 0)
 
-PROFILER_FUNC_VOID(profiler_log(const char *str))
+PROFILER_FUNC_VOID(profiler_log(const char* aStr))
 
 // Gets the stack top of the current thread.
 //
 // The thread must have been previously registered with the profiler, otherwise
 // this method will return nullptr.
 PROFILER_FUNC(void* profiler_get_stack_top(), nullptr)
 
 // End of the functions defined whether the profiler is enabled or not.
@@ -442,18 +444,18 @@ profiler_call_exit(void* aHandle)
   }
 
   PseudoStack* pseudoStack = static_cast<PseudoStack*>(aHandle);
   pseudoStack->pop();
 }
 
 // Adds a marker to the PseudoStack. A no-op if the profiler is inactive or in
 // privacy mode.
-void profiler_add_marker(const char *aMarker,
-                         ProfilerMarkerPayload *aPayload = nullptr);
+void profiler_add_marker(const char* aMarkerName,
+                         ProfilerMarkerPayload* aPayload = nullptr);
 
 #define PROFILER_APPEND_LINE_NUMBER_PASTE(id, line) id ## line
 #define PROFILER_APPEND_LINE_NUMBER_EXPAND(id, line) \
   PROFILER_APPEND_LINE_NUMBER_PASTE(id, line)
 #define PROFILER_APPEND_LINE_NUMBER(id) \
   PROFILER_APPEND_LINE_NUMBER_EXPAND(id, __LINE__)
 
 // Uncomment this to turn on systrace or build with
@@ -501,38 +503,38 @@ void profiler_add_marker(const char *aMa
 #define PROFILER_DEFAULT_INTERVAL 1
 
 namespace mozilla {
 
 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.
-  ProfilerStackFrameRAII(const char *aInfo,
-    js::ProfileEntry::Category aCategory, uint32_t line
+  ProfilerStackFrameRAII(const char* aLabel,
+    js::ProfileEntry::Category aCategory, uint32_t aLine
     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-    mHandle = profiler_call_enter(aInfo, aCategory, this, line);
+    mHandle = profiler_call_enter(aLabel, aCategory, this, aLine);
   }
   ~ProfilerStackFrameRAII() {
     profiler_call_exit(mHandle);
   }
 private:
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
   void* mHandle;
 };
 
 class MOZ_RAII ProfilerStackFrameDynamicRAII {
 public:
-  ProfilerStackFrameDynamicRAII(const char* aInfo,
+  ProfilerStackFrameDynamicRAII(const char* aLabel,
     js::ProfileEntry::Category aCategory, uint32_t aLine,
     const char* aDynamicString)
   {
-    mHandle = profiler_call_enter(aInfo, aCategory, this, aLine,
+    mHandle = profiler_call_enter(aLabel, aCategory, this, aLine,
                                   aDynamicString);
   }
 
   ~ProfilerStackFrameDynamicRAII() {
     profiler_call_exit(mHandle);
   }
 
 private:
@@ -588,43 +590,44 @@ public:
     }
   }
 private:
   bool mIssuedWake;
 };
 
 class MOZ_RAII GeckoProfilerTracingRAII {
 public:
-  GeckoProfilerTracingRAII(const char* aCategory, const char* aInfo,
+  GeckoProfilerTracingRAII(const char* aCategory, const char* aMarkerName,
                            UniqueProfilerBacktrace aBacktrace
                            MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mCategory(aCategory)
-    , mInfo(aInfo)
+    , mMarkerName(aMarkerName)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-    profiler_tracing(mCategory, mInfo, Move(aBacktrace), TRACING_INTERVAL_START);
+    profiler_tracing(mCategory, mMarkerName, Move(aBacktrace),
+                     TRACING_INTERVAL_START);
   }
 
-  GeckoProfilerTracingRAII(const char* aCategory, const char* aInfo
+  GeckoProfilerTracingRAII(const char* aCategory, const char* aMarkerName
                            MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mCategory(aCategory)
-    , mInfo(aInfo)
+    , mMarkerName(aMarkerName)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-    profiler_tracing(mCategory, mInfo, TRACING_INTERVAL_START);
+    profiler_tracing(mCategory, mMarkerName, TRACING_INTERVAL_START);
   }
 
   ~GeckoProfilerTracingRAII() {
-    profiler_tracing(mCategory, mInfo, TRACING_INTERVAL_END);
+    profiler_tracing(mCategory, mMarkerName, TRACING_INTERVAL_END);
   }
 
 protected:
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
   const char* mCategory;
-  const char* mInfo;
+  const char* mMarkerName;
 };
 
 // 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)