diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index a60f328156d9..d48f37f55bce 100755 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -75,6 +75,7 @@ #include "mozilla/Preferences.h" #include "mozilla/Services.h" #include "mozilla/StaticPtr.h" +#include "mozilla/Telemetry.h" #include "mozilla/unused.h" #include "nsAnonymousTemporaryFile.h" #include "nsAppRunner.h" @@ -1749,6 +1750,9 @@ ContentParent::ActorDestroy(ActorDestroyReason why) props->SetPropertyAsUint64(NS_LITERAL_STRING("childID"), mChildID); if (AbnormalShutdown == why) { + Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT, + NS_LITERAL_CSTRING("content"), 1); + props->SetPropertyAsBool(NS_LITERAL_STRING("abnormal"), true); #ifdef MOZ_CRASHREPORTER diff --git a/dom/ipc/CrashReporterParent.cpp b/dom/ipc/CrashReporterParent.cpp index 897388c718b0..e1d618178c24 100644 --- a/dom/ipc/CrashReporterParent.cpp +++ b/dom/ipc/CrashReporterParent.cpp @@ -8,6 +8,8 @@ #include "nsXULAppAPI.h" #include +#include "mozilla/Telemetry.h" + #ifdef MOZ_CRASHREPORTER #include "nsExceptionHandler.h" #include "nsICrashService.h" @@ -171,21 +173,27 @@ CrashReporterParent::NotifyCrashService() int32_t processType; int32_t crashType = nsICrashService::CRASH_TYPE_CRASH; + nsCString telemetryKey; + switch (mProcessType) { case GeckoProcessType_Content: processType = nsICrashService::PROCESS_TYPE_CONTENT; + telemetryKey.AssignLiteral("content"); break; case GeckoProcessType_Plugin: { processType = nsICrashService::PROCESS_TYPE_PLUGIN; + telemetryKey.AssignLiteral("plugin"); nsAutoCString val; if (mNotes.Get(NS_LITERAL_CSTRING("PluginHang"), &val) && val.Equals(NS_LITERAL_CSTRING("1"))) { crashType = nsICrashService::CRASH_TYPE_HANG; + telemetryKey.AssignLiteral("pluginhang"); } break; } case GeckoProcessType_GMPlugin: processType = nsICrashService::PROCESS_TYPE_GMPLUGIN; + telemetryKey.AssignLiteral("gmplugin"); break; default: NS_ERROR("unknown process type"); @@ -193,6 +201,7 @@ CrashReporterParent::NotifyCrashService() } crashService->AddCrash(processType, crashType, mChildDumpID); + Telemetry::Accumulate(Telemetry::SUBPROCESS_CRASHES_WITH_DUMP, telemetryKey, 1); } #endif diff --git a/dom/media/gmp/GMPParent.cpp b/dom/media/gmp/GMPParent.cpp index ae614465eb6c..ed52638bbd69 100644 --- a/dom/media/gmp/GMPParent.cpp +++ b/dom/media/gmp/GMPParent.cpp @@ -30,6 +30,8 @@ using CrashReporter::AnnotationTable; using CrashReporter::GetIDFromMinidump; #endif +#include "mozilla/Telemetry.h" + namespace mozilla { #ifdef LOG @@ -653,6 +655,8 @@ GMPParent::ActorDestroy(ActorDestroyReason aWhy) LOGD(("%s::%s: %p (%d)", __CLASS__, __FUNCTION__, this, (int) aWhy)); #ifdef MOZ_CRASHREPORTER if (AbnormalShutdown == aWhy) { + Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT, + NS_LITERAL_CSTRING("gmplugin"), 1); nsString dumpID; GetCrashID(dumpID); nsString id; diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index 3ac5f02fe13a..285154d77a6c 100755 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -916,6 +916,8 @@ PluginModuleChromeParent::ActorDestroy(ActorDestroyReason why) #ifdef MOZ_CRASHREPORTER ProcessFirstMinidump(); #endif + Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT, + NS_LITERAL_CSTRING("plugin"), 1); } // We can't broadcast settings changes anymore. diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 005dc8de0bc4..e5be10c102b4 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -6968,5 +6968,17 @@ "expires_in_version": "45", "kind": "count", "description": "How many onbeforeunload prompts has the user encountered in their session?" + }, + "SUBPROCESS_ABNORMAL_ABORT": { + "expires_in_version": "never", + "kind": "count", + "keyed": true, + "description": "Counts of plugin/content process abnormal shutdown, whether or not a crash report was available." + }, + "SUBPROCESS_CRASHES_WITH_DUMP": { + "expires_in_version": "never", + "kind": "count", + "keyed": true, + "description": "Counts of plugin and content process crashes which are reported with a crash dump." } }