Backed out changeset ad1034334503 (bug 1347274) for conflict merging m-c to m-i
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 31 May 2017 14:18:56 +0200
changeset 409665 87c84b9fd8a4ad760540b328adc0db25d5ea45f9
parent 409664 f7a450e270f0829f790c139eba118bfdd91edc45
child 409666 f7553df81f14fa4ec5478408d66c7738baf1321a
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)
bugs1347274
milestone55.0a1
backs outad10343345034bf5f0f1c31e529af3c042427573
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
Backed out changeset ad1034334503 (bug 1347274) for conflict merging m-c to m-i
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* aMarkerName,
-                        ProfilerMarkerPayload* aPayload, double aTime)
+  void AddPendingMarker(const char* aMarkerStr, ProfilerMarkerPayload* aPayload,
+                        double aTime)
   {
-    ProfilerMarker* marker = new ProfilerMarker(aMarkerName, aPayload, aTime);
+    ProfilerMarker* marker = new ProfilerMarker(aMarkerStr, 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
@@ -2845,17 +2845,17 @@ profiler_get_backtrace_noalloc(char *out
       output += labelLength;
     }
     *output++ = '\0';
     *output = '\0';
   }
 }
 
 static void
-locked_profiler_add_marker(PSLockRef aLock, const char* aMarkerName,
+locked_profiler_add_marker(PSLockRef aLock, const char* aMarker,
                            ProfilerMarkerPayload* aPayload)
 {
   // This function runs both on and off the main thread.
 
   MOZ_RELEASE_ASSERT(CorePS::Exists());
   MOZ_RELEASE_ASSERT(ActivePS::Exists(aLock) &&
                      !ActivePS::FeaturePrivacy(aLock));
 
@@ -2866,74 +2866,73 @@ 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(aMarkerName, payload.release(),
+  racyInfo->AddPendingMarker(aMarker, payload.release(),
                              delta.ToMilliseconds());
 }
 
 void
-profiler_add_marker(const char* aMarkerName, ProfilerMarkerPayload* aPayload)
+profiler_add_marker(const char* aMarker, ProfilerMarkerPayload* aPayload)
 {
   // This function runs both on and off the main thread.
 
   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, aMarkerName, payload.release());
+  locked_profiler_add_marker(lock, aMarker, payload.release());
 }
 
 void
-profiler_tracing(const char* aCategory, const char* aMarkerName,
-                 TracingKind aKind)
+profiler_tracing(const char* aCategory, const char* aInfo, TracingKind aKind)
 {
   // This function runs both on and off the main thread.
 
   MOZ_RELEASE_ASSERT(CorePS::Exists());
 
   PSAutoLock lock(gPSMutex);
 
   if (!ActivePS::Exists(lock) || ActivePS::FeaturePrivacy(lock)) {
     return;
   }
 
-  auto payload = new ProfilerMarkerTracing(aCategory, aKind);
-  locked_profiler_add_marker(lock, aMarkerName, payload);
+  auto marker = new ProfilerMarkerTracing(aCategory, aKind);
+  locked_profiler_add_marker(lock, aInfo, marker);
 }
 
 void
-profiler_tracing(const char* aCategory, const char* aMarkerName,
+profiler_tracing(const char* aCategory, const char* aInfo,
                  UniqueProfilerBacktrace aCause, TracingKind aKind)
 {
   // This function runs both on and off the main thread.
 
   MOZ_RELEASE_ASSERT(CorePS::Exists());
 
   PSAutoLock lock(gPSMutex);
 
   if (!ActivePS::Exists(lock) || ActivePS::FeaturePrivacy(lock)) {
     return;
   }
 
-  auto payload =
+  auto marker =
     new ProfilerMarkerTracing(aCategory, aKind, mozilla::Move(aCause));
-  locked_profiler_add_marker(lock, aMarkerName, payload);
+  locked_profiler_add_marker(lock, aInfo, marker);
 }
 
 void
 profiler_log(const char* aStr)
 {
   // This function runs both on and off the main thread.
 
   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(marker_name) do {} while (0)
-#define PROFILER_MARKER_PAYLOAD(marker_name, payload) \
+#define PROFILER_MARKER(info) do {} while (0)
+#define PROFILER_MARKER_PAYLOAD(info, 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(marker_name) profiler_add_marker(marker_name)
-#define PROFILER_MARKER_PAYLOAD(marker_name, payload) \
-  profiler_add_marker(marker_name, payload)
+#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
 // |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,21 +206,19 @@ 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* aMarkerName,
+PROFILER_FUNC_VOID(profiler_tracing(const char* aCategory, const char* aInfo,
                                     TracingKind aKind = TRACING_EVENT))
-PROFILER_FUNC_VOID(profiler_tracing(const char* aCategory,
-                                    const char* aMarkerName,
+PROFILER_FUNC_VOID(profiler_tracing(const char* aCategory, const char* aInfo,
                                     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))
 
@@ -444,18 +442,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* aMarkerName,
-                         ProfilerMarkerPayload* aPayload = nullptr);
+void profiler_add_marker(const char *aMarker,
+                         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
@@ -503,38 +501,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 *aLabel,
-    js::ProfileEntry::Category aCategory, uint32_t aLine
+  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(aLabel, aCategory, this, aLine);
+    mHandle = profiler_call_enter(aInfo, aCategory, this, line);
   }
   ~ProfilerStackFrameRAII() {
     profiler_call_exit(mHandle);
   }
 private:
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
   void* mHandle;
 };
 
 class MOZ_RAII ProfilerStackFrameDynamicRAII {
 public:
-  ProfilerStackFrameDynamicRAII(const char* aLabel,
+  ProfilerStackFrameDynamicRAII(const char* aInfo,
     js::ProfileEntry::Category aCategory, uint32_t aLine,
     const char* aDynamicString)
   {
-    mHandle = profiler_call_enter(aLabel, aCategory, this, aLine,
+    mHandle = profiler_call_enter(aInfo, aCategory, this, aLine,
                                   aDynamicString);
   }
 
   ~ProfilerStackFrameDynamicRAII() {
     profiler_call_exit(mHandle);
   }
 
 private:
@@ -590,44 +588,43 @@ public:
     }
   }
 private:
   bool mIssuedWake;
 };
 
 class MOZ_RAII GeckoProfilerTracingRAII {
 public:
-  GeckoProfilerTracingRAII(const char* aCategory, const char* aMarkerName,
+  GeckoProfilerTracingRAII(const char* aCategory, const char* aInfo,
                            UniqueProfilerBacktrace aBacktrace
                            MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mCategory(aCategory)
-    , mMarkerName(aMarkerName)
+    , mInfo(aInfo)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-    profiler_tracing(mCategory, mMarkerName, Move(aBacktrace),
-                     TRACING_INTERVAL_START);
+    profiler_tracing(mCategory, mInfo, Move(aBacktrace), TRACING_INTERVAL_START);
   }
 
-  GeckoProfilerTracingRAII(const char* aCategory, const char* aMarkerName
+  GeckoProfilerTracingRAII(const char* aCategory, const char* aInfo
                            MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mCategory(aCategory)
-    , mMarkerName(aMarkerName)
+    , mInfo(aInfo)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-    profiler_tracing(mCategory, mMarkerName, TRACING_INTERVAL_START);
+    profiler_tracing(mCategory, mInfo, TRACING_INTERVAL_START);
   }
 
   ~GeckoProfilerTracingRAII() {
-    profiler_tracing(mCategory, mMarkerName, TRACING_INTERVAL_END);
+    profiler_tracing(mCategory, mInfo, TRACING_INTERVAL_END);
   }
 
 protected:
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
   const char* mCategory;
-  const char* mMarkerName;
+  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)