Bug 1471588 - Don't pass aComment to PrintBudget, it builds its own comment. r?padenot
MozReview-Commit-ID: KSEEDtDy2kF
--- 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;