Bug 1471588 - Don't pass aComment to PrintBudget, it builds its own comment. r?padenot draft
authorAndreas Pehrson <pehrsons@mozilla.com>
Wed, 27 Jun 2018 15:27:23 +0200
changeset 819609 d227216beb95a26bed157503674cc5f9ea12cc6c
parent 819486 afa310dc89beeb4b7a9564d2c89ff32906f427ad
child 819610 33eaca3a491d7874aa500c046adb750a9fca8ba9
push id116598
push userbmo:apehrson@mozilla.com
push dateWed, 18 Jul 2018 08:46:17 +0000
reviewerspadenot
bugs1471588
milestone63.0a1
Bug 1471588 - Don't pass aComment to PrintBudget, it builds its own comment. r?padenot MozReview-Commit-ID: KSEEDtDy2kF
dom/media/Tracing.cpp
dom/media/Tracing.h
--- a/dom/media/Tracing.cpp
+++ b/dom/media/Tracing.cpp
@@ -35,17 +35,16 @@ AutoTracer::PrintEvent(const char* aName
               " %" PRIu64 ", \"args\": { \"comment\": \"%s\"}},",
            aName, aCategory, TRACING_PHASE_STRINGS[static_cast<int>(aPhase)],
            aTime, aPID, aThread, aComment);
 }
 
 void
 AutoTracer::PrintBudget(const char* aName,
                         const char* aCategory,
-                        const char* aComment,
                         uint64_t aDuration,
                         uint64_t aPID,
                         uint64_t aThread,
                         uint64_t aFrames)
 {
   mLogger.Log("{\"name\": \"%s\", \"cat\": \"%s\", \"ph\": \"X\","
               "\"ts\": %" PRIu64 ", \"dur\": %" PRIu64 ", \"pid\": %" PRIu64 ","
               "\"tid\": %" PRIu64 ", \"args\": { \"comment\": %" PRIu64 "}},",
@@ -65,17 +64,17 @@ AutoTracer::AutoTracer(AsyncLogger& aLog
   , mEventType(aEventType)
   , mPID(aPID)
   , mTID(aTID)
 {
   MOZ_ASSERT(aEventType == EventType::BUDGET);
 
   if (aLogger.Enabled()) {
     float durationUS = (static_cast<float>(aFrames) / aSampleRate) * 1e6;
-    PrintBudget(aLocation, "perf", mComment, durationUS, mPID, mTID, aFrames);
+    PrintBudget(aLocation, "perf", durationUS, mPID, mTID, aFrames, aSampleRate);
   }
 }
 
 AutoTracer::AutoTracer(AsyncLogger& aLogger,
                        const char* aLocation,
                        uint64_t aPID,
                        uint64_t aTID,
                        EventType aEventType,
--- a/dom/media/Tracing.h
+++ b/dom/media/Tracing.h
@@ -74,18 +74,18 @@ public:
              uint64_t aTID,
              EventType aEventType = EventType::DURATION,
              const char* aComment = nullptr);
   AutoTracer(mozilla::AsyncLogger& aLogger,
              const char* aLocation,
              uint64_t aPID,
              uint64_t aTID,
              EventType aEventType,
-             uint64_t aSampleRate,
-             uint64_t aFrames);
+             uint64_t aFrames,
+             uint64_t aSampleRate);
   ~AutoTracer();
 private:
   uint64_t NowInUs();
 
   enum class TracingPhase
   {
     BEGIN,
     END,
@@ -103,17 +103,16 @@ private:
                   const char* aComment,
                   TracingPhase aPhase,
                   uint64_t aTime,
                   uint64_t aPID,
                   uint64_t aThread);
 
   void PrintBudget(const char* aName,
                    const char* aCategory,
-                   const char* aComment,
                    uint64_t aDuration,
                    uint64_t aPID,
                    uint64_t aThread,
                    uint64_t aFrames);
 
   // The logger to use. It musdt have a lifetime longer than the block an
   // instance of this class traces.
   mozilla::AsyncLogger& mLogger;