Bug 1548371 - Fix --enable-task-tracer build. r=gerald
authorMarkus Stange <mstange@themasta.com>
Thu, 02 May 2019 11:09:11 +0000
changeset 531151 523bbc540caf41b1b840e35268790322fa8711f9
parent 531150 5226ccdaaa9e639074be48dc73e5e69f591fa1b6
child 531152 6b2c2ad50bd0ae8ae58d1202e5d37a6611a697a9
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1548371
milestone68.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 1548371 - Fix --enable-task-tracer build. r=gerald Differential Revision: https://phabricator.services.mozilla.com/D29559
tools/profiler/tasktracer/GeckoTaskTracer.cpp
tools/profiler/tasktracer/GeckoTaskTracer.h
--- a/tools/profiler/tasktracer/GeckoTaskTracer.cpp
+++ b/tools/profiler/tasktracer/GeckoTaskTracer.cpp
@@ -385,18 +385,18 @@ void DoAddLabel(const char* aFormat, va_
 
 void StartLogging() {
   sStartTime = GetTimestamp();
   SetLogStarted(true);
 }
 
 void StopLogging() { SetLogStarted(false); }
 
-UniquePtr<nsTArray<nsCString>> GetLoggedData(TimeStamp aTimeStamp) {
-  auto result = MakeUnique<nsTArray<nsCString>>();
+UniquePtr<Vector<nsCString>> GetLoggedData(TimeStamp aTimeStamp) {
+  auto result = MakeUnique<Vector<nsCString>>();
 
   // TODO: This is called from a signal handler. Use semaphore instead.
   StaticMutexAutoLock lock(sMutex);
 
   if (sTraceInfos == nullptr) {
     return result;
   }
 
@@ -405,17 +405,18 @@ UniquePtr<nsTArray<nsCString>> GetLogged
     MutexAutoLock lockLogs(info->mLogsMutex);
     if (info->mObsolete) {
       continue;
     }
 
     nsTArray<nsCString>& strs = info->mStrs;
     for (TraceInfoLogNode* node = info->mLogsHead; node; node = node->mNext) {
       TraceInfoLogType& log = node->mLog;
-      nsCString& buffer = *result->AppendElement();
+      MOZ_RELEASE_ASSERT(result->append(nsCString()));
+      nsCString& buffer = result->back();
 
       switch (log.mType) {
         case ACTION_DISPATCH:
           buffer.AppendPrintf("%d %llu %llu %llu %d %llu", ACTION_DISPATCH,
                               (unsigned long long)log.mDispatch.mTaskId,
                               (unsigned long long)log.mDispatch.mTime,
                               (unsigned long long)log.mDispatch.mSourceEventId,
                               log.mDispatch.mSourceEventType,
--- a/tools/profiler/tasktracer/GeckoTaskTracer.h
+++ b/tools/profiler/tasktracer/GeckoTaskTracer.h
@@ -5,19 +5,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef GECKO_TASK_TRACER_H
 #define GECKO_TASK_TRACER_H
 
 #include "mozilla/Atomics.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/UniquePtr.h"
+#include "mozilla/Vector.h"
 #include "nsCOMPtr.h"
 #include "nsStringFwd.h"
-#include "nsTArrayForwardDeclare.h"
 
 #include <stdarg.h>
 
 /**
  * TaskTracer provides a way to trace the correlation between different tasks
  * across threads and processes. Unlike sampling based profilers, TaskTracer can
  * tell you where a task is dispatched from, what its original source was, how
  * long it waited in the event queue, and how long it took to execute.
@@ -127,17 +127,17 @@ inline void AddLabel(const char* aFormat
     va_start(args, aFormat);
     DoAddLabel(aFormat, args);
     va_end(args);
   }
 }
 
 void StartLogging();
 void StopLogging();
-UniquePtr<nsTArray<nsCString>> GetLoggedData(TimeStamp aStartTime);
+UniquePtr<Vector<nsCString>> GetLoggedData(TimeStamp aStartTime);
 
 // Returns the timestamp when Task Tracer is enabled in this process.
 PRTime GetStartTime();
 
 /**
  * Internal functions.
  */