Add crash reporter annotations for the GPU process status. (
bug 1343650, r=billm)
--- a/gfx/ipc/GPUProcessManager.cpp
+++ b/gfx/ipc/GPUProcessManager.cpp
@@ -32,16 +32,20 @@
#include "VRManagerParent.h"
#include "VsyncBridgeChild.h"
#include "VsyncIOThreadHolder.h"
#include "VsyncSource.h"
#include "mozilla/dom/VideoDecoderManagerChild.h"
#include "mozilla/dom/VideoDecoderManagerParent.h"
#include "MediaPrefs.h"
+#ifdef MOZ_CRASHREPORTER
+# include "nsExceptionHandler.h"
+#endif
+
#if defined(MOZ_WIDGET_ANDROID)
#include "mozilla/widget/AndroidUiThread.h"
#include "mozilla/layers/UiCompositorControllerChild.h"
#endif // defined(MOZ_WIDGET_ANDROID)
namespace mozilla {
namespace gfx {
@@ -302,16 +306,22 @@ GPUProcessManager::OnProcessLaunchComple
mVsyncBridge = VsyncBridgeChild::Create(mVsyncIOThread, mProcessToken, Move(vsyncChild));
mGPUChild->SendInitVsyncBridge(Move(vsyncParent));
nsTArray<LayerTreeIdMapping> mappings;
LayerTreeOwnerTracker::Get()->Iterate([&](uint64_t aLayersId, base::ProcessId aProcessId) {
mappings.AppendElement(LayerTreeIdMapping(aLayersId, aProcessId));
});
mGPUChild->SendAddLayerTreeIdMapping(mappings);
+
+#ifdef MOZ_CRASHREPORTER
+ CrashReporter::AnnotateCrashReport(
+ NS_LITERAL_CSTRING("GPUProcessStatus"),
+ NS_LITERAL_CSTRING("Running"));
+#endif
}
static bool
ShouldLimitDeviceResets(uint32_t count, int32_t deltaMilliseconds)
{
// We decide to limit by comparing the amount of resets that have happened
// and time since the last reset to two prefs.
int32_t timeLimit = gfxPrefs::DeviceResetThresholdMilliseconds();
@@ -525,16 +535,22 @@ GPUProcessManager::DestroyProcess()
mGPUChild = nullptr;
if (mVsyncBridge) {
mVsyncBridge->Close();
mVsyncBridge = nullptr;
}
#if defined(MOZ_WIDGET_ANDROID)
UiCompositorControllerChild::Shutdown();
#endif // defined(MOZ_WIDGET_ANDROID)
+
+#ifdef MOZ_CRASHREPORTER
+ CrashReporter::AnnotateCrashReport(
+ NS_LITERAL_CSTRING("GPUProcessStatus"),
+ NS_LITERAL_CSTRING("Destroyed"));
+#endif
}
RefPtr<CompositorSession>
GPUProcessManager::CreateTopLevelCompositor(nsBaseWidget* aWidget,
LayerManager* aLayerManager,
CSSToLayoutDeviceScale aScale,
const CompositorOptions& aOptions,
bool aUseExternalSurfaceSize,