Bug 1275987 - Add a 'reason for warp' histogram. r=jgilbert draft
authorBenoit Girard <b56girard@gmail.com>
Thu, 26 May 2016 19:05:13 -0400
changeset 371848 579254996e28395c0dcde41b438de85582a43657
parent 371841 75a8fbcbe1273a6f303c5ba25545a23dedcf1761
child 522031 2efe209b804e8c28d15ffa12f9872864594ee0a3
push id19368
push userb56girard@gmail.com
push dateThu, 26 May 2016 23:08:47 +0000
reviewersjgilbert
bugs1275987
milestone49.0a1
Bug 1275987 - Add a 'reason for warp' histogram. r=jgilbert MozReview-Commit-ID: 7dQf7jLupqL
gfx/gl/GLLibraryEGL.cpp
toolkit/components/telemetry/Histograms.json
--- a/gfx/gl/GLLibraryEGL.cpp
+++ b/gfx/gl/GLLibraryEGL.cpp
@@ -4,16 +4,17 @@
 
 #include "GLLibraryEGL.h"
 
 #include "gfxConfig.h"
 #include "gfxCrashReporterUtils.h"
 #include "gfxUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Assertions.h"
+#include "mozilla/Telemetry.h"
 #include "mozilla/unused.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsIGfxInfo.h"
 #include "nsPrintfCString.h"
 #ifdef XP_WIN
 #include "nsWindowsHelpers.h"
 #endif
@@ -139,21 +140,23 @@ GetAndInitWARPDisplay(GLLibraryEGL& egl,
 
     return display;
 }
 
 static bool
 IsAccelAngleSupported(const nsCOMPtr<nsIGfxInfo>& gfxInfo)
 {
     int32_t angleSupport;
-    nsCString discardFailureId;
+    nsCString failureId;
     gfxUtils::ThreadSafeGetFeatureStatus(gfxInfo,
                                          nsIGfxInfo::FEATURE_WEBGL_ANGLE,
-                                         discardFailureId,
+                                         failureId,
                                          &angleSupport);
+    Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_ACCL_FAILURE_ID,
+                          failureId);
     return (angleSupport == nsIGfxInfo::FEATURE_STATUS_OK);
 }
 
 static EGLDisplay
 GetAndInitDisplay(GLLibraryEGL& egl, void* displayType)
 {
     EGLDisplay display = egl.fGetDisplay(displayType);
     if (display == EGL_NO_DISPLAY)
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -1048,16 +1048,24 @@
     "n_buckets": 50,
     "description": "PNG image decode speed (Kbytes/sec)"
   },
   "CANVAS_2D_USED": {
     "expires_in_version": "never",
     "kind": "boolean",
     "description": "2D canvas used"
   },
+  "CANVAS_WEBGL_ACCL_FAILURE_ID": {
+    "alert_emails": ["bgirard@mozilla.com"],
+    "expires_in_version": "never",
+    "kind": "count",
+    "keyed": true,
+    "description": "Track the failure IDs that lead us to reject attempting to create an accelerated context. CANVAS_WEBGL_FAILURE_ID reports the overall WebGL status with the attempt to fallback.",
+    "bug_numbers": [1272808]
+  },
   "CANVAS_WEBGL_FAILURE_ID": {
     "alert_emails": ["bgirard@mozilla.com"],
     "expires_in_version": "never",
     "kind": "count",
     "keyed": true,
     "description": "WebGL runtime and dynamic failure IDs. This will record a count for each context creation success or failure. Each failure id is a unique identifier that can be traced back to a particular failure branch or blocklist rule.",
     "bug_numbers": [1272808]
   },