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
This commit is contained in:
Andrew Osmond 2019-04-30 16:29:48 -04:00
Родитель 17c3cc5d39
Коммит 3a7c78906a
9 изменённых файлов: 23 добавлений и 3 удалений

Просмотреть файл

@ -463,6 +463,7 @@ function getGfxAdapter(aSuffix = "") {
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),
};
@ -1772,7 +1773,7 @@ EnvironmentCache.prototype = {
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();

Просмотреть файл

@ -164,6 +164,7 @@ Structure:
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
@ -171,7 +172,7 @@ Structure:
...
],
// 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

Просмотреть файл

@ -506,6 +506,7 @@ function checkGfxAdapter(data) {
subsysID: "string",
RAM: "number",
driver: "string",
driverVendor: "string",
driverVersion: "string",
driverDate: "string",
GPUActive: "boolean",
@ -631,7 +632,7 @@ function checkSystemSection(data) {
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");

Просмотреть файл

@ -507,6 +507,7 @@ var snapshotFormatters = {
["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"],

Просмотреть файл

@ -49,6 +49,11 @@ AdapterDeviceID:
Graphics adapter name.
type: string
AdapterDriverVendor:
description: >
Graphics adapter driver vendor.
type: string
AdapterDriverVersion:
description: >
Graphics adapter driver version.

Просмотреть файл

@ -206,6 +206,7 @@ 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

Просмотреть файл

@ -443,6 +443,7 @@ var dataProviders = {
adapterSubsysID: null,
adapterRAM: null,
adapterDriver: "adapterDrivers",
adapterDriverVendor: "driverVendor",
adapterDriverVersion: "driverVersion",
adapterDriverDate: "driverDate",
@ -452,6 +453,7 @@ var dataProviders = {
adapterSubsysID2: null,
adapterRAM2: null,
adapterDriver2: "adapterDrivers2",
adapterDriverVendor2: "driverVendor2",
adapterDriverVersion2: "driverVersion2",
adapterDriverDate2: "driverDate2",
isGPU2Active: null,

Просмотреть файл

@ -326,6 +326,9 @@ const SNAPSHOT_SCHEMA = {
adapterDrivers: {
type: "string",
},
driverVendor: {
type: "string",
},
driverVersion: {
type: "string",
},
@ -350,6 +353,9 @@ const SNAPSHOT_SCHEMA = {
adapterDrivers2: {
type: "string",
},
driverVendor2: {
type: "string",
},
driverVersion2: {
type: "string",
},

Просмотреть файл

@ -48,6 +48,8 @@ void GfxInfo::AddCrashReportAnnotations() {
mVendorId);
CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::AdapterDeviceID,
mDeviceId);
CrashReporter::AnnotateCrashReport(
CrashReporter::Annotation::AdapterDriverVendor, mDriverVendor);
CrashReporter::AnnotateCrashReport(
CrashReporter::Annotation::AdapterDriverVersion, mDriverVersion);
}