From 58fa2486628bb76f680e694168c2da7e99708de5 Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Tue, 18 Feb 2014 09:58:40 -0500 Subject: [PATCH] Bug 972856 - Use PR_Now() for CC timestamp in JSON log. r=smaug --- dom/base/nsJSEnvironment.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 0e7d2abc24c..ade9559644c 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -2196,10 +2196,15 @@ nsJSContext::EndCycleCollectionCallback(CycleCollectorResults &aResults) PokeGC(JS::gcreason::CC_WAITING); } - TimeStamp endCCTime = TimeStamp::Now(); + TimeStamp endCCTimeStamp = TimeStamp::Now(); + + PRTime endCCTime; + if (sPostGCEventsToObserver) { + endCCTime = PR_Now(); + } // Log information about the CC via telemetry, JSON and the console. - uint32_t ccNowDuration = TimeBetween(gCCStats.mBeginTime, endCCTime); + uint32_t ccNowDuration = TimeBetween(gCCStats.mBeginTime, endCCTimeStamp); Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_FINISH_IGC, gCCStats.mAnyLockedOut); Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_SYNC_SKIPPABLE, gCCStats.mRanSyncForgetSkippable); Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_FULL, ccNowDuration); @@ -2209,7 +2214,7 @@ nsJSContext::EndCycleCollectionCallback(CycleCollectorResults &aResults) uint32_t timeBetween = TimeBetween(sLastCCEndTime, gCCStats.mBeginTime); Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_TIME_BETWEEN, timeBetween); } - sLastCCEndTime = endCCTime; + sLastCCEndTime = endCCTimeStamp; Telemetry::Accumulate(Telemetry::FORGET_SKIPPABLE_MAX, sMaxForgetSkippableTime / PR_USEC_PER_MSEC);