Bug 1471535 - pt11 - Handle crash reporting for RDD. r=jya,gsvelto

Depends on D8492

Differential Revision: https://phabricator.services.mozilla.com/D8493

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Michael Froman 2018-11-14 18:07:10 +00:00
Родитель ec52863ae2
Коммит 5502525cc3
7 изменённых файлов: 63 добавлений и 6 удалений

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

@ -94,6 +94,9 @@ CrashReporterHost::FinalizeCrashReport()
case GeckoProcessType_GPU:
type = NS_LITERAL_CSTRING("gpu");
break;
case GeckoProcessType_RDD:
type = NS_LITERAL_CSTRING("rdd");
break;
default:
NS_ERROR("unknown process type");
break;
@ -166,6 +169,10 @@ CrashReporterHost::NotifyCrashService(GeckoProcessType aProcessType,
processType = nsICrashService::PROCESS_TYPE_GPU;
telemetryKey.AssignLiteral("gpu");
break;
case GeckoProcessType_RDD:
processType = nsICrashService::PROCESS_TYPE_RDD;
telemetryKey.AssignLiteral("rdd");
break;
default:
NS_ERROR("unknown process type");
return;

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

@ -177,6 +177,9 @@ this.CrashManager.prototype = Object.freeze({
// A crash in the GPU process.
PROCESS_TYPE_GPU: "gpu",
// A crash in the RDD process.
PROCESS_TYPE_RDD: "rdd",
// A real crash.
CRASH_TYPE_CRASH: "crash",
@ -460,7 +463,8 @@ this.CrashManager.prototype = Object.freeze({
// Send a telemetry ping for each non-main process crash
if (processType === this.PROCESS_TYPE_CONTENT ||
processType === this.PROCESS_TYPE_GPU) {
processType === this.PROCESS_TYPE_GPU ||
processType === this.PROCESS_TYPE_RDD) {
this._sendCrashPing(id, processType, date, metadata);
}
})();

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

@ -179,6 +179,9 @@ CrashService.prototype = Object.freeze({
case Ci.nsICrashService.PROCESS_TYPE_GPU:
processType = Services.crashmanager.PROCESS_TYPE_GPU;
break;
case Ci.nsICrashService.PROCESS_TYPE_RDD:
processType = Services.crashmanager.PROCESS_TYPE_RDD;
break;
default:
throw new Error("Unrecognized PROCESS_TYPE: " + processType);
}

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

@ -26,6 +26,7 @@ interface nsICrashService : nsISupports
const long PROCESS_TYPE_PLUGIN = 2;
const long PROCESS_TYPE_GMPLUGIN = 3;
const long PROCESS_TYPE_GPU = 4;
const long PROCESS_TYPE_RDD = 5;
const long CRASH_TYPE_CRASH = 0;
const long CRASH_TYPE_HANG = 1;

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

@ -394,6 +394,8 @@ add_task(async function test_addCrash() {
"gmplugin-crash", DUMMY_DATE);
await m.addCrash(m.PROCESS_TYPE_GPU, m.CRASH_TYPE_CRASH,
"gpu-crash", DUMMY_DATE);
await m.addCrash(m.PROCESS_TYPE_RDD, m.CRASH_TYPE_CRASH,
"rdd-crash", DUMMY_DATE);
await m.addCrash(m.PROCESS_TYPE_MAIN, m.CRASH_TYPE_CRASH,
"changing-item", DUMMY_DATE);
@ -401,7 +403,7 @@ add_task(async function test_addCrash() {
"changing-item", DUMMY_DATE_2);
crashes = await m.getCrashes();
Assert.equal(crashes.length, 9);
Assert.equal(crashes.length, 10);
let map = new Map(crashes.map(crash => [crash.id, crash]));
@ -453,6 +455,12 @@ add_task(async function test_addCrash() {
Assert.equal(crash.type, m.PROCESS_TYPE_GPU + "-" + m.CRASH_TYPE_CRASH);
Assert.ok(crash.isOfType(m.PROCESS_TYPE_GPU, m.CRASH_TYPE_CRASH));
crash = map.get("rdd-crash");
Assert.ok(!!crash);
Assert.equal(crash.crashDate, DUMMY_DATE);
Assert.equal(crash.type, m.PROCESS_TYPE_RDD + "-" + m.CRASH_TYPE_CRASH);
Assert.ok(crash.isOfType(m.PROCESS_TYPE_RDD, m.CRASH_TYPE_CRASH));
crash = map.get("changing-item");
Assert.ok(!!crash);
Assert.equal(crash.crashDate, DUMMY_DATE_2);
@ -465,6 +473,7 @@ add_task(async function test_child_process_crash_ping() {
const EXPECTED_PROCESSES = [
m.PROCESS_TYPE_CONTENT,
m.PROCESS_TYPE_GPU,
m.PROCESS_TYPE_RDD,
];
const UNEXPECTED_PROCESSES = [

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

@ -22,6 +22,7 @@ const {
PROCESS_TYPE_PLUGIN,
PROCESS_TYPE_GMPLUGIN,
PROCESS_TYPE_GPU,
PROCESS_TYPE_RDD,
CRASH_TYPE_CRASH,
CRASH_TYPE_HANG,
SUBMISSION_RESULT_OK,
@ -353,6 +354,33 @@ add_task(async function test_add_gpu_crash() {
Assert.equal(crashes.length, 2);
});
add_task(async function test_add_rdd_crash() {
let s = await getStore();
Assert.ok(
s.addCrash(PROCESS_TYPE_RDD, CRASH_TYPE_CRASH, "id1", new Date())
);
Assert.equal(s.crashesCount, 1);
let c = s.crashes[0];
Assert.ok(c.crashDate);
Assert.equal(c.type, PROCESS_TYPE_RDD + "-" + CRASH_TYPE_CRASH);
Assert.ok(c.isOfType(PROCESS_TYPE_RDD, CRASH_TYPE_CRASH));
Assert.ok(
s.addCrash(PROCESS_TYPE_RDD, CRASH_TYPE_CRASH, "id2", new Date())
);
Assert.equal(s.crashesCount, 2);
Assert.ok(
s.addCrash(PROCESS_TYPE_RDD, CRASH_TYPE_CRASH, "id1", new Date())
);
Assert.equal(s.crashesCount, 2);
let crashes = s.getCrashesOfType(PROCESS_TYPE_RDD, CRASH_TYPE_CRASH);
Assert.equal(crashes.length, 2);
});
add_task(async function test_add_mixed_types() {
let s = await getStore();
@ -364,10 +392,11 @@ add_task(async function test_add_mixed_types() {
s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_CRASH, "pcrash", new Date()) &&
s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_HANG, "phang", new Date()) &&
s.addCrash(PROCESS_TYPE_GMPLUGIN, CRASH_TYPE_CRASH, "gmpcrash", new Date()) &&
s.addCrash(PROCESS_TYPE_GPU, CRASH_TYPE_CRASH, "gpucrash", new Date())
s.addCrash(PROCESS_TYPE_GPU, CRASH_TYPE_CRASH, "gpucrash", new Date()) &&
s.addCrash(PROCESS_TYPE_RDD, CRASH_TYPE_CRASH, "rddcrash", new Date())
);
Assert.equal(s.crashesCount, 8);
Assert.equal(s.crashesCount, 9);
await s.save();
@ -376,7 +405,7 @@ add_task(async function test_add_mixed_types() {
await s.load();
Assert.equal(s.crashesCount, 8);
Assert.equal(s.crashesCount, 9);
let crashes = s.getCrashesOfType(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH);
Assert.equal(crashes.length, 1);
@ -394,6 +423,8 @@ add_task(async function test_add_mixed_types() {
Assert.equal(crashes.length, 1);
crashes = s.getCrashesOfType(PROCESS_TYPE_GPU, CRASH_TYPE_CRASH);
Assert.equal(crashes.length, 1);
crashes = s.getCrashesOfType(PROCESS_TYPE_RDD, CRASH_TYPE_CRASH);
Assert.equal(crashes.length, 1);
});
// Crashes added beyond the high water mark behave properly.

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

@ -11485,7 +11485,9 @@
"gmplugin-crash",
"gmplugin-hang",
"gpu-crash",
"gpu-hang"
"gpu-hang",
"rdd-crash",
"rdd-hang"
],
"releaseChannelCollection": "opt-out",
"description": "An attempt to submit a crash. Keyed on the CrashManager Crash.type."