Bug 1368915 (part 3) - Rename aStartTime parameters as aProcessStartTime where appropriate. r=mstange.
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 02 Jun 2017 09:41:51 +1000
changeset 362637 e7d5a07cede0aa1d2de6fdf13b7f522aa4a1cc22
parent 362636 2019c06e297c20de7afcd05716b6298ee2ea36f2
child 362638 2f636eeb949d07746a412fbf327ce4e4015f2aad
push id31985
push usercbook@mozilla.com
push dateWed, 07 Jun 2017 11:35:06 +0000
treeherdermozilla-central@fb40bcb6155b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1368915
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 1368915 (part 3) - Rename aStartTime parameters as aProcessStartTime where appropriate. r=mstange. This increases naming consistency. The remaining aStartTime parameters within the profiler refer to a different start time than the process start time.
tools/profiler/core/ProfileBuffer.h
tools/profiler/core/ProfileBufferEntry.cpp
tools/profiler/core/ProfilerBacktrace.cpp
tools/profiler/core/ProfilerBacktrace.h
tools/profiler/core/ProfilerMarker.h
tools/profiler/core/ProfilerMarkerPayload.cpp
tools/profiler/core/ThreadInfo.cpp
tools/profiler/core/ThreadInfo.h
tools/profiler/public/ProfilerMarkerPayload.h
--- a/tools/profiler/core/ProfileBuffer.h
+++ b/tools/profiler/core/ProfileBuffer.h
@@ -37,26 +37,28 @@ public:
 
   // Add |aTag| to the buffer, ignoring what kind of entry it is.
   void addTag(const ProfileBufferEntry& aTag);
 
   // Add to the buffer a sample start (ThreadId) entry for aThreadId. Also,
   // record the resulting generation and index in |aLS| if it's non-null.
   void addTagThreadId(int aThreadId, LastSample* aLS);
 
-  void StreamSamplesToJSON(SpliceableJSONWriter& aWriter, int aThreadId, double aSinceTime,
-                           JSContext* cx, UniqueStacks& aUniqueStacks);
+  void StreamSamplesToJSON(SpliceableJSONWriter& aWriter, int aThreadId,
+                           double aSinceTime, JSContext* cx,
+                           UniqueStacks& aUniqueStacks);
   void StreamMarkersToJSON(SpliceableJSONWriter& aWriter, int aThreadId,
-                           const mozilla::TimeStamp& aStartTime,
+                           const mozilla::TimeStamp& aProcessStartTime,
                            double aSinceTime,
                            UniqueStacks& aUniqueStacks);
 
   // Find (via |aLS|) the most recent sample for the thread denoted by
-  // |aThreadId| and clone it, patching in |aStartTime| as appropriate.
-  bool DuplicateLastSample(int aThreadId, const mozilla::TimeStamp& aStartTime,
+  // |aThreadId| and clone it, patching in |aProcessStartTime| as appropriate.
+  bool DuplicateLastSample(int aThreadId,
+                           const mozilla::TimeStamp& aProcessStartTime,
                            LastSample& aLS);
 
   void addStoredMarker(ProfilerMarker* aStoredMarker);
 
   // The following two methods are not signal safe! They delete markers.
   void deleteExpiredStoredMarkers();
   void reset();
 
--- a/tools/profiler/core/ProfileBufferEntry.cpp
+++ b/tools/profiler/core/ProfileBufferEntry.cpp
@@ -707,30 +707,31 @@ void ProfileBuffer::StreamSamplesToJSON(
   if (sample.isSome()) {
     WriteSample(aWriter, *sample);
   }
 }
 
 void
 ProfileBuffer::StreamMarkersToJSON(SpliceableJSONWriter& aWriter,
                                    int aThreadId,
-                                   const TimeStamp& aStartTime,
+                                   const TimeStamp& aProcessStartTime,
                                    double aSinceTime,
                                    UniqueStacks& aUniqueStacks)
 {
   int readPos = mReadPos;
   int currentThreadID = -1;
   while (readPos != mWritePos) {
     ProfileBufferEntry entry = mEntries[readPos];
     if (entry.isThreadId()) {
       currentThreadID = entry.mTagInt;
     } else if (currentThreadID == aThreadId && entry.isMarker()) {
       const ProfilerMarker* marker = entry.getMarker();
       if (marker->GetTime() >= aSinceTime) {
-        entry.getMarker()->StreamJSON(aWriter, aStartTime, aUniqueStacks);
+        entry.getMarker()->StreamJSON(aWriter, aProcessStartTime,
+                                      aUniqueStacks);
       }
     }
     readPos = (readPos + 1) % mEntrySize;
   }
 }
 
 int
 ProfileBuffer::FindLastSampleOfThread(int aThreadId, const LastSample& aLS)
@@ -759,17 +760,18 @@ ProfileBuffer::FindLastSampleOfThread(in
 
   // |aLS| denotes a sample which is older than either two wraparounds or one
   // call to ProfileBuffer::reset.  In either case it is no longer valid.
   MOZ_ASSERT(aLS.mGeneration <= mGeneration - 2);
   return -1;
 }
 
 bool
-ProfileBuffer::DuplicateLastSample(int aThreadId, const TimeStamp& aStartTime,
+ProfileBuffer::DuplicateLastSample(int aThreadId,
+                                   const TimeStamp& aProcessStartTime,
                                    LastSample& aLS)
 {
   int lastSampleStartPos = FindLastSampleOfThread(aThreadId, aLS);
   if (lastSampleStartPos == -1) {
     return false;
   }
 
   MOZ_ASSERT(mEntries[lastSampleStartPos].isThreadId() &&
@@ -783,17 +785,17 @@ ProfileBuffer::DuplicateLastSample(int a
        readPos = (readPos + 1) % mEntrySize) {
     switch (mEntries[readPos].kind()) {
       case ProfileBufferEntry::Kind::ThreadId:
         // We're done.
         return true;
       case ProfileBufferEntry::Kind::Time:
         // Copy with new time
         addTag(ProfileBufferEntry::Time((TimeStamp::Now() -
-                                         aStartTime).ToMilliseconds()));
+                                         aProcessStartTime).ToMilliseconds()));
         break;
       case ProfileBufferEntry::Kind::Marker:
         // Don't copy markers
         break;
       default:
         // Copy anything else we don't know about.
         addTag(mEntries[readPos]);
         break;
--- a/tools/profiler/core/ProfilerBacktrace.cpp
+++ b/tools/profiler/core/ProfilerBacktrace.cpp
@@ -21,22 +21,22 @@ ProfilerBacktrace::ProfilerBacktrace(con
 ProfilerBacktrace::~ProfilerBacktrace()
 {
   MOZ_COUNT_DTOR(ProfilerBacktrace);
   delete mBuffer;
 }
 
 void
 ProfilerBacktrace::StreamJSON(SpliceableJSONWriter& aWriter,
-                              const TimeStamp& aStartTime,
+                              const TimeStamp& aProcessStartTime,
                               UniqueStacks& aUniqueStacks)
 {
   // This call to StreamSamplesAndMarkers() can safely pass in a non-null
   // JSContext. That's because StreamSamplesAndMarkers() only accesses the
   // JSContext when streaming JitReturnAddress entries, and such entries
   // never appear in synchronous samples.
   StreamSamplesAndMarkers(mName.get(), mThreadId,
-                          mBuffer, aWriter, aStartTime,
+                          mBuffer, aWriter, aProcessStartTime,
                           /* aSinceTime */ 0, /* aContext */ nullptr,
                           /* aSavedStreamedSamples */ nullptr,
                           /* aSavedStreamedMarkers */ nullptr,
                           aUniqueStacks);
 }
--- a/tools/profiler/core/ProfilerBacktrace.h
+++ b/tools/profiler/core/ProfilerBacktrace.h
@@ -23,17 +23,17 @@ public:
 
   // ProfilerBacktraces' stacks are deduplicated in the context of the
   // profile that contains the backtrace as a marker payload.
   //
   // That is, markers that contain backtraces should not need their own stack,
   // frame, and string tables. They should instead reuse their parent
   // profile's tables.
   void StreamJSON(SpliceableJSONWriter& aWriter,
-                  const mozilla::TimeStamp& aStartTime,
+                  const mozilla::TimeStamp& aProcessStartTime,
                   UniqueStacks& aUniqueStacks);
 
 private:
   ProfilerBacktrace(const ProfilerBacktrace&);
   ProfilerBacktrace& operator=(const ProfilerBacktrace&);
 
   mozilla::UniqueFreePtr<char> mName;
   int mThreadId;
--- a/tools/profiler/core/ProfilerMarker.h
+++ b/tools/profiler/core/ProfilerMarker.h
@@ -31,33 +31,33 @@ public:
 
   void SetGeneration(uint32_t aGenID) { mGenID = aGenID; }
 
   bool HasExpired(uint32_t aGenID) const { return mGenID + 2 <= aGenID; }
 
   double GetTime() const { return mTime; }
 
   void StreamJSON(SpliceableJSONWriter& aWriter,
-                  const mozilla::TimeStamp& aStartTime,
+                  const mozilla::TimeStamp& aProcessStartTime,
                   UniqueStacks& aUniqueStacks) const
   {
     // Schema:
     //   [name, time, data]
 
     aWriter.StartArrayElement();
     {
       aUniqueStacks.mUniqueStrings.WriteElement(aWriter, mMarkerName.get());
       aWriter.DoubleElement(mTime);
       // TODO: Store the callsite for this marker if available:
       // if have location data
       //   b.NameValue(marker, "location", ...);
       if (mPayload) {
         aWriter.StartObjectElement();
         {
-          mPayload->StreamPayload(aWriter, aStartTime, aUniqueStacks);
+          mPayload->StreamPayload(aWriter, aProcessStartTime, aUniqueStacks);
         }
         aWriter.EndObject();
       }
     }
     aWriter.EndArray();
   }
 
 private:
--- a/tools/profiler/core/ProfilerMarkerPayload.cpp
+++ b/tools/profiler/core/ProfilerMarkerPayload.cpp
@@ -24,32 +24,33 @@ ProfilerMarkerPayload::ProfilerMarkerPay
 
 ProfilerMarkerPayload::~ProfilerMarkerPayload()
 {
 }
 
 void
 ProfilerMarkerPayload::streamCommonProps(const char* aMarkerType,
                                          SpliceableJSONWriter& aWriter,
-                                         const TimeStamp& aStartTime,
+                                         const TimeStamp& aProcessStartTime,
                                          UniqueStacks& aUniqueStacks)
 {
   MOZ_ASSERT(aMarkerType);
   aWriter.StringProperty("type", aMarkerType);
   if (!mStartTime.IsNull()) {
     aWriter.DoubleProperty("startTime",
-                           (mStartTime - aStartTime).ToMilliseconds());
+                           (mStartTime - aProcessStartTime).ToMilliseconds());
   }
   if (!mEndTime.IsNull()) {
-    aWriter.DoubleProperty("endTime", (mEndTime - aStartTime).ToMilliseconds());
+    aWriter.DoubleProperty("endTime",
+                           (mEndTime - aProcessStartTime).ToMilliseconds());
   }
   if (mStack) {
     aWriter.StartObjectProperty("stack");
     {
-      mStack->StreamJSON(aWriter, aStartTime, aUniqueStacks);
+      mStack->StreamJSON(aWriter, aProcessStartTime, aUniqueStacks);
     }
     aWriter.EndObject();
   }
 }
 
 ProfilerMarkerTracing::ProfilerMarkerTracing(const char* aCategory,
                                              TracingKind aKind)
   : mCategory(aCategory)
@@ -65,20 +66,20 @@ ProfilerMarkerTracing::ProfilerMarkerTra
 {
   if (aCause) {
     SetStack(mozilla::Move(aCause));
   }
 }
 
 void
 ProfilerMarkerTracing::StreamPayload(SpliceableJSONWriter& aWriter,
-                                     const TimeStamp& aStartTime,
+                                     const TimeStamp& aProcessStartTime,
                                      UniqueStacks& aUniqueStacks)
 {
-  streamCommonProps("tracing", aWriter, aStartTime, aUniqueStacks);
+  streamCommonProps("tracing", aWriter, aProcessStartTime, aUniqueStacks);
 
   if (GetCategory()) {
     aWriter.StringProperty("category", GetCategory());
   }
 
   if (GetKind() == TRACING_INTERVAL_START) {
     aWriter.StringProperty("interval", "start");
   } else if (GetKind() == TRACING_INTERVAL_END) {
@@ -96,39 +97,40 @@ GPUMarkerPayload::GPUMarkerPayload(
   , mCpuTimeStart(aCpuTimeStart)
   , mCpuTimeEnd(aCpuTimeEnd)
   , mGpuTimeStart(aGpuTimeStart)
   , mGpuTimeEnd(aGpuTimeEnd)
 { }
 
 void
 GPUMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                const TimeStamp& aStartTime,
+                                const TimeStamp& aProcessStartTime,
                                 UniqueStacks& aUniqueStacks)
 {
-  streamCommonProps("gpu_timer_query", aWriter, aStartTime, aUniqueStacks);
+  streamCommonProps("gpu_timer_query", aWriter, aProcessStartTime,
+                    aUniqueStacks);
 
   aWriter.DoubleProperty("cpustart",
-                         (mCpuTimeStart - aStartTime).ToMilliseconds());
+                         (mCpuTimeStart - aProcessStartTime).ToMilliseconds());
   aWriter.DoubleProperty("cpuend",
-                         (mCpuTimeEnd - aStartTime).ToMilliseconds());
+                         (mCpuTimeEnd - aProcessStartTime).ToMilliseconds());
   aWriter.IntProperty("gpustart", (int)mGpuTimeStart);
   aWriter.IntProperty("gpuend", (int)mGpuTimeEnd);
 }
 
 ProfilerMarkerImagePayload::ProfilerMarkerImagePayload(gfxASurface *aImg)
   : mImg(aImg)
 { }
 
 void
 ProfilerMarkerImagePayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                          const TimeStamp& aStartTime,
+                                          const TimeStamp& aProcessStartTime,
                                           UniqueStacks& aUniqueStacks)
 {
-  streamCommonProps("innerHTML", aWriter, aStartTime, aUniqueStacks);
+  streamCommonProps("innerHTML", aWriter, aProcessStartTime, aUniqueStacks);
   // TODO: Finish me
   //aWriter.NameValue("innerHTML", "<img src=''/>");
 }
 
 IOMarkerPayload::IOMarkerPayload(const char* aSource,
                                  const char* aFilename,
                                  const mozilla::TimeStamp& aStartTime,
                                  const mozilla::TimeStamp& aEndTime,
@@ -142,20 +144,20 @@ IOMarkerPayload::IOMarkerPayload(const c
 }
 
 IOMarkerPayload::~IOMarkerPayload(){
   free(mFilename);
 }
 
 void
 IOMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                               const TimeStamp& aStartTime,
+                               const TimeStamp& aProcessStartTime,
                                UniqueStacks& aUniqueStacks)
 {
-  streamCommonProps("io", aWriter, aStartTime, aUniqueStacks);
+  streamCommonProps("io", aWriter, aProcessStartTime, aUniqueStacks);
   aWriter.StringProperty("source", mSource);
   if (mFilename != nullptr) {
     aWriter.StringProperty("filename", mFilename);
   }
 }
 
 UserTimingMarkerPayload::UserTimingMarkerPayload(const nsAString& aName,
                                                  const mozilla::TimeStamp& aStartTime)
@@ -175,20 +177,20 @@ UserTimingMarkerPayload::UserTimingMarke
 }
 
 UserTimingMarkerPayload::~UserTimingMarkerPayload()
 {
 }
 
 void
 UserTimingMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                       const TimeStamp& aStartTime,
+                                       const TimeStamp& aProcessStartTime,
                                        UniqueStacks& aUniqueStacks)
 {
-  streamCommonProps("UserTiming", aWriter, aStartTime, aUniqueStacks);
+  streamCommonProps("UserTiming", aWriter, aProcessStartTime, aUniqueStacks);
   aWriter.StringProperty("name", NS_ConvertUTF16toUTF8(mName).get());
   aWriter.StringProperty("entryType", mEntryType);
 }
 
 DOMEventMarkerPayload::DOMEventMarkerPayload(const nsAString& aType, uint16_t aPhase,
                                              const mozilla::TimeStamp& aStartTime,
                                              const mozilla::TimeStamp& aEndTime)
   : ProfilerMarkerPayload(aStartTime, aEndTime, nullptr)
@@ -198,20 +200,20 @@ DOMEventMarkerPayload::DOMEventMarkerPay
 }
 
 DOMEventMarkerPayload::~DOMEventMarkerPayload()
 {
 }
 
 void
 DOMEventMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                     const TimeStamp& aStartTime,
+                                     const TimeStamp& aProcessStartTime,
                                      UniqueStacks& aUniqueStacks)
 {
-  streamCommonProps("DOMEvent", aWriter, aStartTime, aUniqueStacks);
+  streamCommonProps("DOMEvent", aWriter, aProcessStartTime, aUniqueStacks);
   aWriter.StringProperty("type", NS_ConvertUTF16toUTF8(mType).get());
   aWriter.IntProperty("phase", mPhase);
 }
 
 void
 ProfilerJSEventMarker(const char *event)
 {
     PROFILER_MARKER(event);
@@ -222,17 +224,17 @@ LayerTranslationPayload::LayerTranslatio
   : ProfilerMarkerPayload(mozilla::TimeStamp::Now(), mozilla::TimeStamp::Now(), nullptr)
   , mLayer(aLayer)
   , mPoint(aPoint)
 {
 }
 
 void
 LayerTranslationPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                       const TimeStamp& aStartTime,
+                                       const TimeStamp& aProcessStartTime,
                                        UniqueStacks& aUniqueStacks)
 {
   const size_t bufferSize = 32;
   char buffer[bufferSize];
   SprintfLiteral(buffer, "%p", mLayer);
 
   aWriter.StringProperty("layer", buffer);
   aWriter.IntProperty("x", mPoint.x);
@@ -243,72 +245,72 @@ LayerTranslationPayload::StreamPayload(S
 TouchDataPayload::TouchDataPayload(const mozilla::ScreenIntPoint& aPoint)
   : ProfilerMarkerPayload(mozilla::TimeStamp::Now(), mozilla::TimeStamp::Now(), nullptr)
 {
   mPoint = aPoint;
 }
 
 void
 TouchDataPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                const TimeStamp& aStartTime,
+                                const TimeStamp& aProcessStartTime,
                                 UniqueStacks& aUniqueStacks)
 {
   aWriter.IntProperty("x", mPoint.x);
   aWriter.IntProperty("y", mPoint.y);
 }
 
 VsyncPayload::VsyncPayload(mozilla::TimeStamp aVsyncTimestamp)
   : ProfilerMarkerPayload(aVsyncTimestamp, aVsyncTimestamp, nullptr)
   , mVsyncTimestamp(aVsyncTimestamp)
 {
 }
 
 void
 VsyncPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                            const TimeStamp& aStartTime,
+                            const TimeStamp& aProcessStartTime,
                             UniqueStacks& aUniqueStacks)
 {
   aWriter.DoubleProperty("vsync",
-                         (mVsyncTimestamp - aStartTime).ToMilliseconds());
+                         (mVsyncTimestamp - aProcessStartTime).ToMilliseconds());
   aWriter.StringProperty("category", "VsyncTimestamp");
 }
 
 void
 GCSliceMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                    const mozilla::TimeStamp& aStartTime,
+                                    const mozilla::TimeStamp& aProcessStartTime,
                                     UniqueStacks& aUniqueStacks)
 {
   MOZ_ASSERT(mTimingJSON);
-  streamCommonProps("GCSlice", aWriter, aStartTime, aUniqueStacks);
+  streamCommonProps("GCSlice", aWriter, aProcessStartTime, aUniqueStacks);
   if (mTimingJSON) {
     aWriter.SplicedJSONProperty("timings", mTimingJSON.get());
   } else {
     aWriter.NullProperty("timings");
   }
 }
 
 void
 GCMajorMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                    const mozilla::TimeStamp& aStartTime,
+                                    const mozilla::TimeStamp& aProcessStartTime,
                                     UniqueStacks& aUniqueStacks)
 {
   MOZ_ASSERT(mTimingJSON);
-  streamCommonProps("GCMajor", aWriter, aStartTime, aUniqueStacks);
+  streamCommonProps("GCMajor", aWriter, aProcessStartTime, aUniqueStacks);
   if (mTimingJSON) {
     aWriter.SplicedJSONProperty("timings", mTimingJSON.get());
   } else {
     aWriter.NullProperty("timings");
   }
 }
 
 void
 GCMinorMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                    const mozilla::TimeStamp& aStartTime,
+                                    const mozilla::TimeStamp& aProcessStartTime,
                                     UniqueStacks& aUniqueStacks)
 {
   MOZ_ASSERT(mTimingData);
-  streamCommonProps("GCMinor", aWriter, aStartTime, aUniqueStacks);
+  streamCommonProps("GCMinor", aWriter, aProcessStartTime, aUniqueStacks);
   if (mTimingData) {
     aWriter.SplicedJSONProperty("nurseryTimings", mTimingData.get());
   } else {
     aWriter.NullProperty("nurseryTimings");
   }
 }
--- a/tools/profiler/core/ThreadInfo.cpp
+++ b/tools/profiler/core/ThreadInfo.cpp
@@ -66,27 +66,27 @@ void
 ThreadInfo::StopProfiling()
 {
   mResponsiveness.reset();
   mIsBeingProfiled = false;
 }
 
 void
 ThreadInfo::StreamJSON(ProfileBuffer* aBuffer, SpliceableJSONWriter& aWriter,
-                       const TimeStamp& aStartTime, double aSinceTime)
+                       const TimeStamp& aProcessStartTime, double aSinceTime)
 {
   // mUniqueStacks may already be emplaced from FlushSamplesAndMarkers.
   if (!mUniqueStacks.isSome()) {
     mUniqueStacks.emplace(mContext);
   }
 
   aWriter.Start(SpliceableJSONWriter::SingleLineStyle);
   {
-    StreamSamplesAndMarkers(Name(), ThreadId(), aBuffer, aWriter, aStartTime,
-                            aSinceTime, mContext,
+    StreamSamplesAndMarkers(Name(), ThreadId(), aBuffer, aWriter,
+                            aProcessStartTime, aSinceTime, mContext,
                             mSavedStreamedSamples.get(),
                             mSavedStreamedMarkers.get(), *mUniqueStacks);
     mSavedStreamedSamples.reset();
     mSavedStreamedMarkers.reset();
 
     aWriter.StartObjectProperty("stackTable");
     {
       {
@@ -133,17 +133,17 @@ ThreadInfo::StreamJSON(ProfileBuffer* aB
   mUniqueStacks.reset();
 }
 
 void
 StreamSamplesAndMarkers(const char* aName,
                         int aThreadId,
                         ProfileBuffer* aBuffer,
                         SpliceableJSONWriter& aWriter,
-                        const TimeStamp& aStartTime,
+                        const TimeStamp& aProcessStartTime,
                         double aSinceTime,
                         JSContext* aContext,
                         char* aSavedStreamedSamples,
                         char* aSavedStreamedMarkers,
                         UniqueStacks& aUniqueStacks)
 {
   aWriter.StringProperty("processType",
                          XRE_ChildProcessTypeToString(XRE_GetProcessType()));
@@ -189,27 +189,27 @@ StreamSamplesAndMarkers(const char* aNam
     }
 
     aWriter.StartArrayProperty("data");
     {
       if (aSavedStreamedMarkers) {
         MOZ_ASSERT(aSinceTime == 0);
         aWriter.Splice(aSavedStreamedMarkers);
       }
-      aBuffer->StreamMarkersToJSON(aWriter, aThreadId, aStartTime, aSinceTime,
-                                   aUniqueStacks);
+      aBuffer->StreamMarkersToJSON(aWriter, aThreadId, aProcessStartTime,
+                                   aSinceTime, aUniqueStacks);
     }
     aWriter.EndArray();
   }
   aWriter.EndObject();
 }
 
 void
 ThreadInfo::FlushSamplesAndMarkers(ProfileBuffer* aBuffer,
-                                   const TimeStamp& aStartTime)
+                                   const TimeStamp& aProcessStartTime)
 {
   // This function is used to serialize the current buffer just before
   // JSContext destruction.
   MOZ_ASSERT(mContext);
 
   // Unlike StreamJSObject, do not surround the samples in brackets by calling
   // aWriter.{Start,End}BareList. The result string will be a comma-separated
   // list of JSON object literals that will prepended by StreamJSObject into
@@ -229,17 +229,17 @@ ThreadInfo::FlushSamplesAndMarkers(Profi
     b.EndBareList();
     mSavedStreamedSamples = b.WriteFunc()->CopyData();
   }
 
   {
     SpliceableChunkedJSONWriter b;
     b.StartBareList();
     {
-      aBuffer->StreamMarkersToJSON(b, mThreadId, aStartTime,
+      aBuffer->StreamMarkersToJSON(b, mThreadId, aProcessStartTime,
                                    /* aSinceTime = */ 0, *mUniqueStacks);
     }
     b.EndBareList();
     mSavedStreamedMarkers = b.WriteFunc()->CopyData();
   }
 
   // Reset the buffer. Attempting to symbolicate JS samples after mContext has
   // gone away will crash.
--- a/tools/profiler/core/ThreadInfo.h
+++ b/tools/profiler/core/ThreadInfo.h
@@ -199,22 +199,23 @@ private:
 
   //
   // The following code is only used for threads that are being profiled, i.e.
   // for which IsBeingProfiled() returns true.
   //
 
 public:
   void StreamJSON(ProfileBuffer* aBuffer, SpliceableJSONWriter& aWriter,
-                  const mozilla::TimeStamp& aStartTime, double aSinceTime);
+                  const mozilla::TimeStamp& aProcessStartTime,
+                  double aSinceTime);
 
   // Call this method when the JS entries inside the buffer are about to
   // become invalid, i.e., just before JS shutdown.
   void FlushSamplesAndMarkers(ProfileBuffer* aBuffer,
-                              const mozilla::TimeStamp& aStartTime);
+                              const mozilla::TimeStamp& aProcessStartTime);
 
   // Returns nullptr if this is not the main thread or if this thread is not
   // being profiled.
   ThreadResponsiveness* GetThreadResponsiveness()
   {
     ThreadResponsiveness* responsiveness = mResponsiveness.ptrOr(nullptr);
     MOZ_ASSERT(!!responsiveness == (mIsMainThread && mIsBeingProfiled));
     return responsiveness;
@@ -361,16 +362,16 @@ private:
   // of the most recent sample for this thread.
   ProfileBuffer::LastSample mLastSample;
 };
 
 void
 StreamSamplesAndMarkers(const char* aName, int aThreadId,
                         ProfileBuffer* aBuffer,
                         SpliceableJSONWriter& aWriter,
-                        const mozilla::TimeStamp& aStartTime,
+                        const mozilla::TimeStamp& aProcessStartTime,
                         double aSinceTime,
                         JSContext* aContext,
                         char* aSavedStreamedSamples,
                         char* aSavedStreamedMarkers,
                         UniqueStacks& aUniqueStacks);
 
 #endif  // ThreadInfo_h
--- a/tools/profiler/public/ProfilerMarkerPayload.h
+++ b/tools/profiler/public/ProfilerMarkerPayload.h
@@ -49,28 +49,28 @@ public:
    * Called from the main thread
    */
   virtual ~ProfilerMarkerPayload();
 
   /**
    * Called from the main thread
    */
   virtual void StreamPayload(SpliceableJSONWriter& aWriter,
-                             const mozilla::TimeStamp& aStartTime,
+                             const mozilla::TimeStamp& aProcessStartTime,
                              UniqueStacks& aUniqueStacks) = 0;
 
   mozilla::TimeStamp GetStartTime() const { return mStartTime; }
 
 protected:
   /**
    * Called from the main thread
    */
   void streamCommonProps(const char* aMarkerType,
                          SpliceableJSONWriter& aWriter,
-                         const mozilla::TimeStamp& aStartTime,
+                         const mozilla::TimeStamp& aProcessStartTime,
                          UniqueStacks& aUniqueStacks);
 
   void SetStack(UniqueProfilerBacktrace aStack) { mStack = mozilla::Move(aStack); }
 
 private:
   mozilla::TimeStamp  mStartTime;
   mozilla::TimeStamp  mEndTime;
   UniqueProfilerBacktrace  mStack;
@@ -82,64 +82,65 @@ public:
   ProfilerMarkerTracing(const char* aCategory, TracingKind aKind);
   ProfilerMarkerTracing(const char* aCategory, TracingKind aKind,
                         UniqueProfilerBacktrace aCause);
 
   const char *GetCategory() const { return mCategory; }
   TracingKind GetKind() const { return mKind; }
 
   virtual void StreamPayload(SpliceableJSONWriter& aWriter,
-                             const mozilla::TimeStamp& aStartTime,
+                             const mozilla::TimeStamp& aProcessStartTime,
                              UniqueStacks& aUniqueStacks) override;
 
 private:
   const char *mCategory;
   TracingKind mKind;
 };
 
 class ProfilerMarkerImagePayload : public ProfilerMarkerPayload
 {
 public:
   explicit ProfilerMarkerImagePayload(gfxASurface *aImg);
 
   virtual void StreamPayload(SpliceableJSONWriter& aWriter,
-                             const mozilla::TimeStamp& aStartTime,
+                             const mozilla::TimeStamp& aProcessStartTime,
                              UniqueStacks& aUniqueStacks) override;
 
 private:
   RefPtr<gfxASurface> mImg;
 };
 
 class IOMarkerPayload : public ProfilerMarkerPayload
 {
 public:
-  IOMarkerPayload(const char* aSource, const char* aFilename, const mozilla::TimeStamp& aStartTime,
+  IOMarkerPayload(const char* aSource, const char* aFilename,
+                  const mozilla::TimeStamp& aStartTime,
                   const mozilla::TimeStamp& aEndTime,
                   UniqueProfilerBacktrace aStack);
   ~IOMarkerPayload();
 
   virtual void StreamPayload(SpliceableJSONWriter& aWriter,
-                             const mozilla::TimeStamp& aStartTime,
+                             const mozilla::TimeStamp& aProcessStartTime,
                              UniqueStacks& aUniqueStacks) override;
 
 private:
   const char* mSource;
   char* mFilename;
 };
 
 class DOMEventMarkerPayload : public ProfilerMarkerPayload
 {
 public:
   DOMEventMarkerPayload(const nsAString& aType, uint16_t aPhase,
                         const mozilla::TimeStamp& aStartTime,
                         const mozilla::TimeStamp& aEndTime);
   ~DOMEventMarkerPayload();
 
   virtual void StreamPayload(SpliceableJSONWriter& aWriter,
-                             const mozilla::TimeStamp& aStartTime,
+                             const mozilla::TimeStamp& aProcessStartTime,
                              UniqueStacks& aUniqueStacks) override;
 
 private:
   nsString mType;
   uint16_t mPhase;
 };
 
 class UserTimingMarkerPayload : public ProfilerMarkerPayload
@@ -148,17 +149,17 @@ public:
   UserTimingMarkerPayload(const nsAString& aName,
                           const mozilla::TimeStamp& aStartTime);
   UserTimingMarkerPayload(const nsAString& aName,
                           const mozilla::TimeStamp& aStartTime,
                           const mozilla::TimeStamp& aEndTime);
   ~UserTimingMarkerPayload();
 
   virtual void StreamPayload(SpliceableJSONWriter& aWriter,
-                             const mozilla::TimeStamp& aStartTime,
+                             const mozilla::TimeStamp& aProcessStartTime,
                              UniqueStacks& aUniqueStacks) override;
 
 private:
   // Either "mark" or "measure".
   const char* mEntryType;
   nsString mName;
 };
 
@@ -168,17 +169,17 @@ private:
  */
 class LayerTranslationPayload : public ProfilerMarkerPayload
 {
 public:
   LayerTranslationPayload(mozilla::layers::Layer* aLayer,
                           mozilla::gfx::Point aPoint);
 
   virtual void StreamPayload(SpliceableJSONWriter& aWriter,
-                             const mozilla::TimeStamp& aStartTime,
+                             const mozilla::TimeStamp& aProcessStartTime,
                              UniqueStacks& aUniqueStacks) override;
 
 private:
   mozilla::layers::Layer* mLayer;
   mozilla::gfx::Point mPoint;
 };
 
 #include "Units.h"    // For ScreenIntPoint
@@ -189,51 +190,51 @@ private:
  */
 class TouchDataPayload : public ProfilerMarkerPayload
 {
 public:
   explicit TouchDataPayload(const mozilla::ScreenIntPoint& aPoint);
   virtual ~TouchDataPayload() {}
 
   virtual void StreamPayload(SpliceableJSONWriter& aWriter,
-                             const mozilla::TimeStamp& aStartTime,
+                             const mozilla::TimeStamp& aProcessStartTime,
                              UniqueStacks& aUniqueStacks) override;
 
 private:
   mozilla::ScreenIntPoint mPoint;
 };
 
 /**
  * Tracks when a vsync occurs according to the HardwareComposer.
  */
 class VsyncPayload : public ProfilerMarkerPayload
 {
 public:
   explicit VsyncPayload(mozilla::TimeStamp aVsyncTimestamp);
   virtual ~VsyncPayload() {}
 
   virtual void StreamPayload(SpliceableJSONWriter& aWriter,
-                             const mozilla::TimeStamp& aStartTime,
+                             const mozilla::TimeStamp& aProcessStartTime,
                              UniqueStacks& aUniqueStacks) override;
 
 private:
   mozilla::TimeStamp mVsyncTimestamp;
 };
 
 class GPUMarkerPayload : public ProfilerMarkerPayload
 {
 public:
   GPUMarkerPayload(const mozilla::TimeStamp& aCpuTimeStart,
                    const mozilla::TimeStamp& aCpuTimeEnd,
                    uint64_t aGpuTimeStart,
                    uint64_t aGpuTimeEnd);
   ~GPUMarkerPayload() {}
 
   virtual void StreamPayload(SpliceableJSONWriter& aWriter,
-                             const mozilla::TimeStamp& aStartTime,
+                             const mozilla::TimeStamp& aProcessStartTime,
                              UniqueStacks& aUniqueStacks) override;
 
 private:
   mozilla::TimeStamp mCpuTimeStart;
   mozilla::TimeStamp mCpuTimeEnd;
   uint64_t mGpuTimeStart;
   uint64_t mGpuTimeEnd;
 };
@@ -246,17 +247,17 @@ public:
                        JS::UniqueChars&& aTimingJSON)
    : ProfilerMarkerPayload(aStartTime, aEndTime, nullptr),
      mTimingJSON(mozilla::Move(aTimingJSON))
   {}
 
   virtual ~GCSliceMarkerPayload() {}
 
   void StreamPayload(SpliceableJSONWriter& aWriter,
-                     const mozilla::TimeStamp& aStartTime,
+                     const mozilla::TimeStamp& aProcessStartTime,
                      UniqueStacks& aUniqueStacks) override;
 
 private:
   JS::UniqueChars mTimingJSON;
 };
 
 class GCMajorMarkerPayload : public ProfilerMarkerPayload
 {
@@ -266,17 +267,17 @@ public:
                        JS::UniqueChars&& aTimingJSON)
    : ProfilerMarkerPayload(aStartTime, aEndTime, nullptr),
      mTimingJSON(mozilla::Move(aTimingJSON))
   {}
 
   virtual ~GCMajorMarkerPayload() {}
 
   void StreamPayload(SpliceableJSONWriter& aWriter,
-                     const mozilla::TimeStamp& aStartTime,
+                     const mozilla::TimeStamp& aProcessStartTime,
                      UniqueStacks& aUniqueStacks) override;
 
 private:
   JS::UniqueChars mTimingJSON;
 };
 
 class GCMinorMarkerPayload : public ProfilerMarkerPayload
 {
@@ -286,17 +287,17 @@ public:
                        JS::UniqueChars&& aTimingData)
    : ProfilerMarkerPayload(aStartTime, aEndTime, nullptr),
      mTimingData(mozilla::Move(aTimingData))
   {}
 
   virtual ~GCMinorMarkerPayload() {};
 
   void StreamPayload(SpliceableJSONWriter& aWriter,
-                     const mozilla::TimeStamp& aStartTime,
+                     const mozilla::TimeStamp& aProcessStartTime,
                      UniqueStacks& aUniqueStacks) override;
 
 private:
   JS::UniqueChars mTimingData;
 };
 
 
 #endif // PROFILER_MARKERS_H