Bug 1351528 (part 1) - Streamline TracingMetadata. r=mstange.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 29 Mar 2017 13:52:47 +1100
changeset 398416 a04997cb00e9b907c3fc85c8ec1037cf5db611bd
parent 398415 e4ecf720b3a1cad1629a7552a559bdb0eed64650
child 398417 198705c67281eb64995acc8329079f5dfaa09ad4
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
bugs1351528
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 1351528 (part 1) - Streamline TracingMetadata. r=mstange. This patch: - Removes TRACING_EVENT_BACKTRACE, which is unused. - Removes TRACING_DEFAULT and replaces all its uses with TRACING_EVENT, because there is no difference in how those two are used. - Removes TRACING_TIMESTAMP, which is unused and also doesn't do anything different to TRACING_EVENT.
tools/profiler/core/ProfilerMarkers.cpp
tools/profiler/core/platform.cpp
tools/profiler/public/GeckoProfiler.h
--- a/tools/profiler/core/ProfilerMarkers.cpp
+++ b/tools/profiler/core/ProfilerMarkers.cpp
@@ -49,19 +49,16 @@ ProfilerMarkerPayload::streamCommonProps
     aWriter.EndObject();
   }
 }
 
 ProfilerMarkerTracing::ProfilerMarkerTracing(const char* aCategory, TracingMetadata aMetaData)
   : mCategory(aCategory)
   , mMetaData(aMetaData)
 {
-  if (aMetaData == TRACING_EVENT_BACKTRACE) {
-    SetStack(profiler_get_backtrace());
-  }
 }
 
 ProfilerMarkerTracing::ProfilerMarkerTracing(const char* aCategory, TracingMetadata aMetaData,
                                              UniqueProfilerBacktrace aCause)
   : mCategory(aCategory)
   , mMetaData(aMetaData)
 {
   if (aCause) {
@@ -74,22 +71,21 @@ ProfilerMarkerTracing::StreamPayload(Spl
                                      const TimeStamp& aStartTime,
                                      UniqueStacks& aUniqueStacks)
 {
   streamCommonProps("tracing", aWriter, aStartTime, aUniqueStacks);
 
   if (GetCategory()) {
     aWriter.StringProperty("category", GetCategory());
   }
-  if (GetMetaData() != TRACING_DEFAULT) {
-    if (GetMetaData() == TRACING_INTERVAL_START) {
-      aWriter.StringProperty("interval", "start");
-    } else if (GetMetaData() == TRACING_INTERVAL_END) {
-      aWriter.StringProperty("interval", "end");
-    }
+
+  if (GetMetaData() == TRACING_INTERVAL_START) {
+    aWriter.StringProperty("interval", "start");
+  } else if (GetMetaData() == TRACING_INTERVAL_END) {
+    aWriter.StringProperty("interval", "end");
   }
 }
 
 GPUMarkerPayload::GPUMarkerPayload(
   const mozilla::TimeStamp& aCpuTimeStart,
   const mozilla::TimeStamp& aCpuTimeEnd,
   uint64_t aGpuTimeStart,
   uint64_t aGpuTimeEnd)
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -3099,17 +3099,17 @@ profiler_tracing(const char* aCategory, 
   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, TRACING_EVENT);
+  profiler_tracing("log", aStr);
 }
 
 void
 profiler_set_js_context(JSContext* aCx)
 {
   // This function runs both on and off the main thread.
 
   MOZ_ASSERT(aCx);
--- a/tools/profiler/public/GeckoProfiler.h
+++ b/tools/profiler/public/GeckoProfiler.h
@@ -36,22 +36,19 @@ namespace dom {
 class Promise;
 } // namespace dom
 
 } // namespace mozilla
 
 class nsIProfilerStartParams;
 
 enum TracingMetadata {
-  TRACING_DEFAULT,
+  TRACING_EVENT,
   TRACING_INTERVAL_START,
   TRACING_INTERVAL_END,
-  TRACING_EVENT,
-  TRACING_EVENT_BACKTRACE,
-  TRACING_TIMESTAMP
 };
 
 class ProfilerBacktrace;
 
 struct ProfilerBacktraceDestructor
 {
   void operator()(ProfilerBacktrace*);
 };
@@ -122,20 +119,20 @@ using UniqueProfilerBacktrace =
 
 #endif  // defined(MOZ_GECKO_PROFILER)
 
 // 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,
-                                    TracingMetadata metaData = TRACING_DEFAULT))
+                                    TracingMetadata metaData = TRACING_EVENT))
 PROFILER_FUNC_VOID(profiler_tracing(const char* aCategory, const char* aInfo,
                                     UniqueProfilerBacktrace aCause,
-                                    TracingMetadata metaData = TRACING_DEFAULT))
+                                    TracingMetadata metaData = 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))
 
 // Clean up the profiler module, stopping it if required. This function may
 // also save a shutdown profile if requested. No profiler calls should happen