Bug 1436778 Add an assertion to hopefully get a reproduction for a hard-to-repro timer jitter bug r=baku
☠☠ backed out by 7c3b8b5a6ac8 ☠ ☠
authorTom Ritter <tom@mozilla.com>
Tue, 10 Apr 2018 13:08:25 -0500
changeset 466839 1e6febc9f5af217779860536398cd1c60122e2e1
parent 466838 840e168e50abfb1593e918f2a939524854631564
child 466840 d10dc4dc4162b15320bf468adaf5cf0859666c23
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1436778
milestone61.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 1436778 Add an assertion to hopefully get a reproduction for a hard-to-repro timer jitter bug r=baku MozReview-Commit-ID: D4zt1v1tjOs
dom/performance/PerformanceTiming.cpp
--- a/dom/performance/PerformanceTiming.cpp
+++ b/dom/performance/PerformanceTiming.cpp
@@ -81,16 +81,25 @@ PerformanceTiming::PerformanceTiming(Per
   MOZ_ASSERT(aPerformance, "Parent performance object should be provided");
 
   mTimingData.reset(new PerformanceTimingData(aChannel, aHttpChannel,
     aPerformance->IsSystemPrincipal()
     ? aZeroTime
     : nsRFPService::ReduceTimePrecisionAsMSecs(aZeroTime,
         aPerformance->GetRandomTimelineSeed())));
 
+#ifdef DEBUG
+  if (mTimingData->ResponseStartHighRes(aPerformance) - mTimingData->ZeroTime() < 0) {
+    MOZ_CRASH_UNSAFE_PRINTF("Heisenbug Reproduced: Please file line in 1436778. %s %f - %f (%f)",
+      (aPerformance->IsSystemPrincipal() ? "System" : "Not-System"),
+      mTimingData->ResponseStartHighRes(aPerformance),
+      mTimingData->ZeroTime(), aZeroTime);
+  }
+#endif
+
   // Non-null aHttpChannel implies that this PerformanceTiming object is being
   // used for subresources, which is irrelevant to this probe.
   if (!aHttpChannel &&
       nsContentUtils::IsPerformanceTimingEnabled() &&
       IsTopLevelContentDocument()) {
     Telemetry::Accumulate(Telemetry::TIME_TO_RESPONSE_START_MS,
                           mTimingData->ResponseStartHighRes(aPerformance) -
                             mTimingData->ZeroTime());