Bug 1544105 - Part 2. Add new gfx driver vendor field to telemetry and about:support. r=jrmuizel,chutten,flod data-r=bmiroglio
☠☠ backed out by 7d2ca22948eb ☠ ☠
authorAndrew Osmond <aosmond@mozilla.com>
Tue, 30 Apr 2019 16:29:48 -0400
changeset 531395 215c2693d28175e3d2a51cc0441f3f17da08096b
parent 531394 16d5af6fd55cb53900fec3d30ec64d7e2c903999
child 531396 5d9d5394671f06885abdd48267fe00359daf5181
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, chutten, flod
bugs1544105
milestone68.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 1544105 - Part 2. Add new gfx driver vendor field to telemetry and about:support. r=jrmuizel,chutten,flod data-r=bmiroglio Expose the driver vendor information (applies to Linux only at this moment) to crash report telemetry and about:support. This will be useful when debugging issues to know specifically what driver is in use. Also expose the monitor information for Linux. Part 1 provides an implementation to get the monitor information on said platform. Differential Revision: https://phabricator.services.mozilla.com/D29472
toolkit/components/telemetry/app/TelemetryEnvironment.jsm
toolkit/components/telemetry/docs/data/environment.rst
toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
toolkit/content/aboutSupport.js
toolkit/crashreporter/CrashAnnotations.yaml
toolkit/locales/en-US/toolkit/about/aboutSupport.ftl
toolkit/modules/Troubleshoot.jsm
widget/GfxInfoX11.cpp
--- a/toolkit/components/telemetry/app/TelemetryEnvironment.jsm
+++ b/toolkit/components/telemetry/app/TelemetryEnvironment.jsm
@@ -458,16 +458,17 @@ function getGfxAdapter(aSuffix = "") {
 
   return {
     description: getGfxField("adapterDescription" + aSuffix, null),
     vendorID: getGfxField("adapterVendorID" + aSuffix, null),
     deviceID: getGfxField("adapterDeviceID" + aSuffix, null),
     subsysID: getGfxField("adapterSubsysID" + aSuffix, null),
     RAM: memoryMB,
     driver: getGfxField("adapterDriver" + aSuffix, null),
+    driverVendor: getGfxField("adapterDriverVendor" + aSuffix, null),
     driverVersion: getGfxField("adapterDriverVersion" + aSuffix, null),
     driverDate: getGfxField("adapterDriverDate" + aSuffix, null),
   };
 }
 
 /**
  * Gets the service pack and build information on Windows platforms. The initial version
  * was copied from nsUpdateService.js.
@@ -1767,17 +1768,17 @@ EnvironmentCache.prototype = {
       // The following line is disabled due to main thread jank and will be enabled
       // again as part of bug 1154500.
       // DWriteVersion: getGfxField("DWriteVersion", null),
       adapters: [],
       monitors: [],
       features: {},
     };
 
-    if (!["android", "linux"].includes(AppConstants.platform)) {
+    if (AppConstants.platform !== "android") {
       let gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
       try {
         gfxData.monitors = gfxInfo.getMonitors();
       } catch (e) {
         this._log.error("nsIGfxInfo.getMonitors() caught error", e);
       }
     }
 
--- a/toolkit/components/telemetry/docs/data/environment.rst
+++ b/toolkit/components/telemetry/docs/data/environment.rst
@@ -159,24 +159,25 @@ Structure:
             adapters: [
               {
                 description: <string>, // e.g. "Intel(R) HD Graphics 4600", null on failure
                 vendorID: <string>, // null on failure
                 deviceID: <string>, // null on failure
                 subsysID: <string>, // null on failure
                 RAM: <number>, // in MB, null on failure
                 driver: <string>, // null on failure
+                driverVendor: <string>, // null on failure
                 driverVersion: <string>, // null on failure
                 driverDate: <string>, // null on failure
                 GPUActive: <bool>, // currently always true for the first adapter
               },
               ...
             ],
             // Note: currently only added on Desktop. On Linux, only a single
-            // monitor is returned representing the entire virtual screen.
+            // monitor is returned for the primary screen.
             monitors: [
               {
                 screenWidth: <number>,  // screen width in pixels
                 screenHeight: <number>, // screen height in pixels
                 refreshRate: <number>,  // refresh rate in hertz (present on Windows only).
                                         //  (values <= 1 indicate an unknown value)
                 pseudoDisplay: <bool>,  // networked screen (present on Windows only)
                 scale: <number>,        // backing scale factor (present on Mac only)
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
@@ -501,16 +501,17 @@ function checkPartnerSection(data, isIni
 function checkGfxAdapter(data) {
   const EXPECTED_ADAPTER_FIELDS_TYPES = {
     description: "string",
     vendorID: "string",
     deviceID: "string",
     subsysID: "string",
     RAM: "number",
     driver: "string",
+    driverVendor: "string",
     driverVersion: "string",
     driverDate: "string",
     GPUActive: "boolean",
   };
 
   for (let f in EXPECTED_ADAPTER_FIELDS_TYPES) {
     Assert.ok(f in data, f + " must be available.");
 
@@ -626,17 +627,17 @@ function checkSystemSection(data) {
   Assert.ok(gfxData.adapters.length > 0, "There must be at least one GFX adapter.");
   for (let adapter of gfxData.adapters) {
     checkGfxAdapter(adapter);
   }
   Assert.equal(typeof gfxData.adapters[0].GPUActive, "boolean");
   Assert.ok(gfxData.adapters[0].GPUActive, "The first GFX adapter must be active.");
 
   Assert.ok(Array.isArray(gfxData.monitors));
-  if (gIsWindows || gIsMac) {
+  if (gIsWindows || gIsMac || gIsLinux) {
     Assert.ok(gfxData.monitors.length >= 1, "There is at least one monitor.");
     Assert.equal(typeof gfxData.monitors[0].screenWidth, "number");
     Assert.equal(typeof gfxData.monitors[0].screenHeight, "number");
     if (gIsWindows) {
       Assert.equal(typeof gfxData.monitors[0].refreshRate, "number");
       Assert.equal(typeof gfxData.monitors[0].pseudoDisplay, "boolean");
     }
     if (gIsMac) {
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -502,16 +502,17 @@ var snapshotFormatters = {
       delete data.directWriteVersion;
     }
 
     // Adapter tbodies.
     let adapterKeys = [
       ["adapterDescription", "gpu-description"],
       ["adapterVendorID", "gpu-vendor-id"],
       ["adapterDeviceID", "gpu-device-id"],
+      ["driverVendor", "gpu-driver-vendor"],
       ["driverVersion", "gpu-driver-version"],
       ["driverDate", "gpu-driver-date"],
       ["adapterDrivers", "gpu-drivers"],
       ["adapterSubsysID", "gpu-subsys-id"],
       ["adapterRAM", "gpu-ram"],
     ];
 
     function showGpu(id, suffix) {
--- a/toolkit/crashreporter/CrashAnnotations.yaml
+++ b/toolkit/crashreporter/CrashAnnotations.yaml
@@ -44,16 +44,21 @@ ActualStreamLen:
     Actual length of an IPC proxy stream.
   type: integer
 
 AdapterDeviceID:
   description: >
     Graphics adapter name.
   type: string
 
+AdapterDriverVendor:
+  description: >
+    Graphics adapter driver vendor.
+  type: string
+
 AdapterDriverVersion:
   description: >
     Graphics adapter driver version.
   type: string
 
 AdapterSubsysID:
   description: >
     Graphics adapter subsystem ID.
--- a/toolkit/locales/en-US/toolkit/about/aboutSupport.ftl
+++ b/toolkit/locales/en-US/toolkit/about/aboutSupport.ftl
@@ -201,16 +201,17 @@ missing = Missing
 gpu-process-pid = GPUProcessPid
 gpu-process = GPUProcess
 gpu-description = Description
 gpu-vendor-id = Vendor ID
 gpu-device-id = Device ID
 gpu-subsys-id = Subsys ID
 gpu-drivers = Drivers
 gpu-ram = RAM
+gpu-driver-vendor = Driver Vendor
 gpu-driver-version = Driver Version
 gpu-driver-date = Driver Date
 gpu-active = Active
 webgl1-wsiinfo = WebGL 1 Driver WSI Info
 webgl1-renderer = WebGL 1 Driver Renderer
 webgl1-version = WebGL 1 Driver Version
 webgl1-driver-extensions = WebGL 1 Driver Extensions
 webgl1-extensions = WebGL 1 Extensions
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -438,25 +438,27 @@ var dataProviders = {
     // object are the same as the names of keys in aboutSupport.properties.
     let gfxInfoProps = {
       adapterDescription: null,
       adapterVendorID: null,
       adapterDeviceID: null,
       adapterSubsysID: null,
       adapterRAM: null,
       adapterDriver: "adapterDrivers",
+      adapterDriverVendor: "driverVendor",
       adapterDriverVersion: "driverVersion",
       adapterDriverDate: "driverDate",
 
       adapterDescription2: null,
       adapterVendorID2: null,
       adapterDeviceID2: null,
       adapterSubsysID2: null,
       adapterRAM2: null,
       adapterDriver2: "adapterDrivers2",
+      adapterDriverVendor2: "driverVendor2",
       adapterDriverVersion2: "driverVersion2",
       adapterDriverDate2: "driverDate2",
       isGPU2Active: null,
 
       D2DEnabled: "direct2DEnabled",
       DWriteEnabled: "directWriteEnabled",
       DWriteVersion: "directWriteVersion",
       cleartypeParameters: "clearTypeParameters",
--- a/widget/GfxInfoX11.cpp
+++ b/widget/GfxInfoX11.cpp
@@ -44,16 +44,18 @@ nsresult GfxInfo::Init() {
 }
 
 void GfxInfo::AddCrashReportAnnotations() {
   CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::AdapterVendorID,
                                      mVendorId);
   CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::AdapterDeviceID,
                                      mDeviceId);
   CrashReporter::AnnotateCrashReport(
+      CrashReporter::Annotation::AdapterDriverVendor, mDriverVendor);
+  CrashReporter::AnnotateCrashReport(
       CrashReporter::Annotation::AdapterDriverVersion, mDriverVersion);
 }
 
 void GfxInfo::GetData() {
   // to understand this function, see bug 639842. We retrieve the OpenGL driver
   // information in a separate process to protect against bad drivers.
 
   // if glxtest_pipe == -1, that means that we already read the information