Bug 1870021 - Add some GPU process telemetry probes. r=jrmuizel

Add probes for total number of launch attempts and unstable number of
launch attempts. Port expired CRASH_FALLBACKS probe to glean and renew
it, telling us the number of times we handled each crash fallback with
each method. And finally, add a probe to tell us the status of the GPU
process gfxFeature - this is already available on desktop via the
telemetry environment, but adding a glean probe allows us to gather
the data on Android too.

Differential Revision: https://phabricator.services.mozilla.com/D196866
This commit is contained in:
Jamie Nicol 2023-12-21 11:43:39 +00:00
Родитель b459a017eb
Коммит 6ff47ae896
4 изменённых файлов: 80 добавлений и 26 удалений

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

@ -24,6 +24,7 @@
#include "mozilla/dom/ContentParent.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/gfx/GPUChild.h"
#include "mozilla/glean/GleanMetrics.h"
#include "mozilla/ipc/Endpoint.h"
#include "mozilla/ipc/ProcessChild.h"
#include "mozilla/layers/APZCTreeManagerChild.h"
@ -70,12 +71,6 @@ namespace gfx {
using namespace mozilla::layers;
enum class FallbackType : uint32_t {
NONE = 0,
DECODINGDISABLED,
DISABLED,
};
static StaticAutoPtr<GPUProcessManager> sSingleton;
GPUProcessManager* GPUProcessManager::Get() { return sSingleton; }
@ -223,8 +218,11 @@ bool GPUProcessManager::LaunchGPUProcess() {
auto newTime = TimeStamp::Now();
if (!IsProcessStable(newTime)) {
mUnstableProcessAttempts++;
mozilla::glean::gpu_process::unstable_launch_attempts.Set(
mUnstableProcessAttempts);
}
mTotalProcessAttempts++;
mozilla::glean::gpu_process::total_launch_attempts.Set(mTotalProcessAttempts);
mProcessAttemptLastTime = newTime;
mProcessStable = false;
@ -296,8 +294,11 @@ bool GPUProcessManager::MaybeDisableGPUProcess(const char* aMessage,
gfxPlatform::DisableGPUProcess();
Telemetry::Accumulate(Telemetry::GPU_PROCESS_CRASH_FALLBACKS,
uint32_t(FallbackType::DISABLED));
mozilla::glean::gpu_process::feature_status.Set(
gfxConfig::GetFeature(Feature::GPU_PROCESS)
.GetStatusAndFailureIdString());
mozilla::glean::gpu_process::crash_fallbacks.Get("disabled"_ns).Add(1);
DestroyProcess();
ShutdownVsyncIOThread();
@ -808,12 +809,11 @@ void GPUProcessManager::OnProcessUnexpectedShutdown(GPUProcessHost* aHost) {
layers_gpu_process_max_restarts_with_decoder()) &&
mDecodeVideoOnGpuProcess) {
mDecodeVideoOnGpuProcess = false;
Telemetry::Accumulate(Telemetry::GPU_PROCESS_CRASH_FALLBACKS,
uint32_t(FallbackType::DECODINGDISABLED));
mozilla::glean::gpu_process::crash_fallbacks.Get("decoding_disabled"_ns)
.Add(1);
HandleProcessLost();
} else {
Telemetry::Accumulate(Telemetry::GPU_PROCESS_CRASH_FALLBACKS,
uint32_t(FallbackType::NONE));
mozilla::glean::gpu_process::crash_fallbacks.Get("none"_ns).Add(1);
HandleProcessLost();
}
}

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

@ -27,6 +27,70 @@ paint:
expires: never
telemetry_mirror: PAINT_BUILD_DISPLAYLIST_TIME
gpu_process:
feature_status:
type: string
description: >
Current status of the GPU process feature
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
data_sensitivity:
- technical
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- jnicol@mozilla.com
expires: never
crash_fallbacks:
type: labeled_counter
description: >
How often we use different fallbacks when the GPU process crashes
labels:
- none
- decoding_disabled
- disabled
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
data_sensitivity:
- technical
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- jnicol@mozilla.com
expires: never
total_launch_attempts:
type: quantity
description: >
The number of total GPU process launch attempts.
unit: launches
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
data_sensitivity:
- technical
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- jnicol@mozilla.com
expires: never
unstable_launch_attempts:
type: quantity
description: >
The number of consecutive unstable launch attempts.
unit: launches
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
data_sensitivity:
- technical
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- jnicol@mozilla.com
expires: never
wr:
gpu_wait_time:
type: timing_distribution

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

@ -935,6 +935,10 @@ void gfxPlatform::Init() {
}
#endif
mozilla::glean::gpu_process::feature_status.Set(
gfxConfig::GetFeature(Feature::GPU_PROCESS)
.GetStatusAndFailureIdString());
if (gfxConfig::IsEnabled(Feature::GPU_PROCESS)) {
GPUProcessManager* gpu = GPUProcessManager::Get();
Unused << gpu->LaunchGPUProcess();

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

@ -1434,20 +1434,6 @@
"n_buckets": 100,
"description": "GPU process initialization (excluding XPCOM and fork time) time in milliseconds"
},
"GPU_PROCESS_CRASH_FALLBACKS": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec"],
"alert_emails": [
"gfx-telemetry-alerts@mozilla.com",
"gsquelart@mozilla.com"
],
"expires_in_version": "70",
"bug_numbers": [1338011],
"kind": "enumerated",
"releaseChannelCollection": "opt-out",
"n_values": 10,
"description": "Count how often we use different fallbacks when the GPU process crashes: None=0, GPUProcessDecodingDisabled=1, GPUProcessDisabled=2"
},
"MEMORY_RESIDENT_FAST": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec"],