Bug 1110818 - Measure crash and breakpad rates for subprocesses (plugin/gmplugin/content), r=gfritzsche

--HG--
extra : rebase_source : d5817f37804323f59d46c9c22c13f0588f2512fc
This commit is contained in:
Benjamin Smedberg 2014-12-12 14:13:28 -05:00
Родитель 6ddc077746
Коммит 9f21c59029
5 изменённых файлов: 31 добавлений и 0 удалений

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

@ -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

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

@ -8,6 +8,8 @@
#include "nsXULAppAPI.h"
#include <time.h>
#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

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

@ -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;

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

@ -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.

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

@ -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."
}
}