Bug 1501046 - Skip reporting checkerboarding to telemetry if the sanity test is running. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 24 Oct 2018 17:08:36 +0000
changeset 491174 798b3777f30f4170fb094e1acce33eb70dcbd44a
parent 491173 7790c75ca3911352162feecf5b61dbe29233b259
child 491175 3a7ba1fe0277d580a678b86ab92d4496d4fe6681
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersbotond
bugs1501046
milestone65.0a1
Bug 1501046 - Skip reporting checkerboarding to telemetry if the sanity test is running. r=botond This is not really the best fix (a better one would be to ensure that the displayport is set on the root element of the gfx sanity window), but should do as a stopgap solution. Differential Revision: https://phabricator.services.mozilla.com/D9667
gfx/layers/apz/src/AsyncPanZoomController.cpp
gfx/thebes/gfxPrefs.h
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -4103,23 +4103,27 @@ AsyncPanZoomController::ReportCheckerboa
   UpdateCheckerboardEvent(lock, magnitude);
 }
 
 void
 AsyncPanZoomController::UpdateCheckerboardEvent(const MutexAutoLock& aProofOfLock,
                                                 uint32_t aMagnitude)
 {
   if (mCheckerboardEvent && mCheckerboardEvent->RecordFrameInfo(aMagnitude)) {
-    // This checkerboard event is done. Report some metrics to telemetry.
-    mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_SEVERITY,
-      mCheckerboardEvent->GetSeverity());
-    mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_PEAK,
-      mCheckerboardEvent->GetPeak());
-    mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_DURATION,
-      (uint32_t)mCheckerboardEvent->GetDuration().ToMilliseconds());
+    // This checkerboard event is done. Report some metrics to telemetry, but
+    // skip reporting if the sanity checker window is running, because we get
+    // checkerboarding reported on that window that we don't really care about.
+    if (!gfxPrefs::SanityTestRunning()) {
+      mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_SEVERITY,
+        mCheckerboardEvent->GetSeverity());
+      mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_PEAK,
+        mCheckerboardEvent->GetPeak());
+      mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_DURATION,
+        (uint32_t)mCheckerboardEvent->GetDuration().ToMilliseconds());
+    }
 
     mPotentialCheckerboardTracker.CheckerboardDone();
 
     if (gfxPrefs::APZRecordCheckerboarding()) {
       // if the pref is enabled, also send it to the storage class. it may be
       // chosen for public display on about:checkerboard, the hall of fame for
       // checkerboard events.
       uint32_t severity = mCheckerboardEvent->GetSeverity();
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -736,16 +736,18 @@ private:
                                                                MouseWheelRootScrollVerticalFactor, int32_t, 0);
   DECL_GFX_PREF(Live, "mousewheel.transaction.ignoremovedelay",MouseWheelIgnoreMoveDelayMs, int32_t, (int32_t)100);
   DECL_GFX_PREF(Live, "mousewheel.transaction.timeout",        MouseWheelTransactionTimeoutMs, int32_t, (int32_t)1500);
 
   DECL_GFX_PREF(Live, "nglayout.debug.widget_update_flashing", WidgetUpdateFlashing, bool, false);
 
   DECL_GFX_PREF(Live, "print.font-variations-as-paths",        PrintFontVariationsAsPaths, bool, true);
 
+  DECL_GFX_PREF(Live, "sanity-test.running",                   SanityTestRunning, bool, false);
+
   DECL_GFX_PREF(Once, "slider.snapMultiplier",                 SliderSnapMultiplier, int32_t, 0);
 
   DECL_GFX_PREF(Live, "test.events.async.enabled",             TestEventsAsyncEnabled, bool, false);
   DECL_GFX_PREF(Live, "test.mousescroll",                      MouseScrollTestingEnabled, bool, false);
 
   DECL_GFX_PREF(Live, "toolkit.scrollbox.horizontalScrollDistance", ToolkitHorizontalScrollDistance, int32_t, 5);
   DECL_GFX_PREF(Live, "toolkit.scrollbox.verticalScrollDistance",   ToolkitVerticalScrollDistance, int32_t, 3);