Bug 1297792 - Add a diagnostic button to kill the GPU process from about:support r=dvander,mconley
authorGeorge Wright <george@mozilla.com>
Tue, 01 Nov 2016 16:46:48 -0400
changeset 321450 7157478b9a48d4a6f49fc5de16cac244caf84ea3
parent 321449 131019a5ba42fa6a492e44a20f90c37dd8e5427b
child 321451 d457a5086a6f20597f3757c0a3001fa33bd56d5c
push id30928
push userphilringnalda@gmail.com
push dateTue, 08 Nov 2016 04:38:37 +0000
treeherdermozilla-central@f13e90d496cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander, mconley
bugs1297792
milestone52.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 1297792 - Add a diagnostic button to kill the GPU process from about:support r=dvander,mconley
toolkit/content/aboutSupport.js
toolkit/locales/en-US/chrome/global/aboutSupport.properties
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -285,16 +285,34 @@ var snapshotFormatters = {
           $.new("td", String(val)),
         ]);
       });
       addRows("diagnostics", trs);
 
       delete data.info;
     }
 
+    if (AppConstants.NIGHTLY_BUILD) {
+      let windowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor)
+                              .getInterface(Ci.nsIDOMWindowUtils);
+      let gpuProcessPid = windowUtils.gpuProcessPid;
+
+      if (gpuProcessPid != -1) {
+        let gpuProcessKillButton = $.new("button");
+
+        gpuProcessKillButton.addEventListener("click", function() {
+          windowUtils.terminateGPUProcess();
+        });
+
+        gpuProcessKillButton.textContent = strings.GetStringFromName("gpuProcessKillButton");
+        addRow("diagnostics", "GPUProcessPid", gpuProcessPid);
+        addRow("diagnostics", "GPUProcess", [gpuProcessKillButton]);
+      }
+    }
+
     // graphics-failures-tbody tbody
     if ("failures" in data) {
       // If indices is there, it should be the same length as failures,
       // (see Troubleshoot.jsm) but we check anyway:
       if ("indices" in data && data.failures.length == data.indices.length) {
         let combined = [];
         for (let i = 0; i < data.failures.length; i++) {
           let assembled = assembleFromGraphicsFailure(i, data);
--- a/toolkit/locales/en-US/chrome/global/aboutSupport.properties
+++ b/toolkit/locales/en-US/chrome/global/aboutSupport.properties
@@ -81,16 +81,17 @@ bugLink = bug %1$S
 # LOCALIZATION NOTE %1$S will be replaced with an arbitrary identifier
 # string that can be searched on DXR/MXR or grepped in the source tree.
 unknownFailure = Blocklisted; failure code %1$S
 d3d11layersCrashGuard = D3D11 Compositor
 d3d11videoCrashGuard = D3D11 Video Decoder
 d3d9videoCrashGuard = D3D9 Video Decoder
 glcontextCrashGuard = OpenGL
 resetOnNextRestart = Reset on Next Restart
+gpuProcessKillButton = Terminate GPU Process
 
 minLibVersions = Expected minimum version
 loadedLibVersions = Version in use
 
 hasSeccompBPF = Seccomp-BPF (System Call Filtering)
 hasSeccompTSync = Seccomp Thread Synchronization
 hasUserNamespaces = User Namespaces
 hasPrivilegedUserNamespaces = User Namespaces for privileged processes