Bug 1471588 - Include sample rate in budget comment. r?padenot
MozReview-Commit-ID: Ge74gpH3mFI
--- a/dom/media/Tracing.cpp
+++ b/dom/media/Tracing.cpp
@@ -38,22 +38,23 @@ AutoTracer::PrintEvent(const char* aName
}
void
AutoTracer::PrintBudget(const char* aName,
const char* aCategory,
uint64_t aDuration,
uint64_t aPID,
uint64_t aThread,
- uint64_t aFrames)
+ uint64_t aFrames,
+ uint64_t aSampleRate)
{
mLogger.Log("{\"name\": \"%s\", \"cat\": \"%s\", \"ph\": \"X\","
"\"ts\": %" PRIu64 ", \"dur\": %" PRIu64 ", \"pid\": %" PRIu64 ","
- "\"tid\": %" PRIu64 ", \"args\": { \"comment\": %" PRIu64 "}},",
- aName, aCategory, NowInUs(), aDuration, aPID, aThread, aFrames);
+ "\"tid\": %" PRIu64 ", \"args\": { \"comment\": \"%" PRIu64 "/%" PRIu64 "\"}},",
+ aName, aCategory, NowInUs(), aDuration, aPID, aThread, aFrames, aSampleRate);
}
AutoTracer::AutoTracer(AsyncLogger& aLogger,
const char* aLocation,
uint64_t aPID,
uint64_t aTID,
EventType aEventType,
uint64_t aFrames,
--- a/dom/media/Tracing.h
+++ b/dom/media/Tracing.h
@@ -106,17 +106,18 @@ private:
uint64_t aPID,
uint64_t aThread);
void PrintBudget(const char* aName,
const char* aCategory,
uint64_t aDuration,
uint64_t aPID,
uint64_t aThread,
- uint64_t aFrames);
+ uint64_t aFrames,
+ uint64_t aSampleRate);
// The logger to use. It musdt have a lifetime longer than the block an
// instance of this class traces.
mozilla::AsyncLogger& mLogger;
// The location for this trace point, arbitrary string literal, often the
// name of the calling function, with a static lifetime.
const char* mLocation;
// A comment for this trace point, abitrary string literal with a static