Skip to content

Commit

Permalink
Bug 1772216: Add telemetry probe to measure time spent waiting for th…
Browse files Browse the repository at this point in the history
…e GPU. r=mstange

Differential Revision: https://phabricator.services.mozilla.com/D148075
  • Loading branch information
Bas-moz committed Jun 8, 2022
1 parent 4ec85b3 commit a4fb177
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
16 changes: 16 additions & 0 deletions gfx/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ paint:
telemetry_mirror: PAINT_BUILD_DISPLAYLIST_TIME

wr:
gpu_wait_time:
type: timing_distribution
description: >
The time spent waiting for the GPU to complete previously issued drawing
commands.
time_unit: microsecond
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1772216
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1772216
data_sensitivity:
- technical
notification_emails:
- [email protected]
expires: never
telemetry_mirror: WR_GPU_WAIT_TIME
rasterize_glyphs_time:
type: timing_distribution
description: >
Expand Down
3 changes: 3 additions & 0 deletions gfx/webrender_bindings/RenderThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/gfx/GPUParent.h"
#include "mozilla/gfx/GPUProcessManager.h"
#include "mozilla/glean/GleanMetrics.h"
#include "mozilla/layers/CompositableInProcessManager.h"
#include "mozilla/layers/CompositorThread.h"
#include "mozilla/layers/CompositorBridgeParent.h"
Expand Down Expand Up @@ -564,7 +565,9 @@ void RenderThread::UpdateAndRender(
// The wait is necessary for Textures recycling of AsyncImagePipelineManager
// and for avoiding GPU queue is filled with too much tasks.
// WaitForGPU's implementation is different for each platform.
auto timerId = glean::wr::gpu_wait_time.Start();
renderer->WaitForGPU();
glean::wr::gpu_wait_time.StopAndAccumulate(std::move(timerId));
} else {
// Update frame id for NotifyPipelinesUpdated() when rendering does not
// happen, either because rendering was not requested or the frame was
Expand Down
11 changes: 11 additions & 0 deletions toolkit/components/telemetry/Histograms.json
Original file line number Diff line number Diff line change
Expand Up @@ -16090,6 +16090,17 @@
"labels": ["NoOverflow", "Desktop", "ButNotMinScaleSize", "MinScaleSize"],
"description": "How common are different types of out-of-reach viewport overflow?"
},
"WR_GPU_WAIT_TIME": {
"record_in_processes": [ "main", "gpu" ],
"products": [ "firefox", "fennec", "geckoview_streaming" ],
"alert_emails": [ "[email protected]" ],
"bug_numbers": [ 1772216 ],
"expires_in_version": "never",
"kind": "exponential",
"high": 1000,
"n_buckets": 50,
"description": "The time spent waiting for the GPU to complete previously issued drawing commands in milliseconds"
},
"WR_SCENEBUILD_TIME": {
"record_in_processes": ["main", "gpu"],
"products": ["firefox", "fennec", "geckoview_streaming"],
Expand Down

0 comments on commit a4fb177

Please sign in to comment.