Commit 6b778298 authored by kylechar's avatar kylechar Committed by Commit Bot

Add GPU.Scheduler.RunTaskTime histogram

The histogram records the wall time for each GPU task. This will
eventually be used to add a slow report trigger to capture traces for
long running tasks from canary.

Bug: 1064662
Change-Id: I30ec4a7f583fc197f916a55eae7dd3b1fbf57bf4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2144340Reviewed-by: default avatarEtienne Bergeron <etienneb@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759239}
parent 492147c8
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/timer/elapsed_timer.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "base/trace_event/traced_value.h" #include "base/trace_event/traced_value.h"
#include "gpu/command_buffer/service/sync_point_manager.h" #include "gpu/command_buffer/service/sync_point_manager.h"
...@@ -518,6 +520,7 @@ void Scheduler::RunNextTask() { ...@@ -518,6 +520,7 @@ void Scheduler::RunNextTask() {
scheduling_queue_.pop_back(); scheduling_queue_.pop_back();
TRACE_EVENT1("gpu", "Scheduler::RunNextTask", "state", state.AsValue()); TRACE_EVENT1("gpu", "Scheduler::RunNextTask", "state", state.AsValue());
base::ElapsedTimer task_timer;
Sequence* sequence = GetSequence(state.sequence_id); Sequence* sequence = GetSequence(state.sequence_id);
DCHECK(sequence); DCHECK(sequence);
...@@ -567,6 +570,11 @@ void Scheduler::RunNextTask() { ...@@ -567,6 +570,11 @@ void Scheduler::RunNextTask() {
} }
} }
UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES(
"GPU.Scheduler.RunTaskTime", task_timer.Elapsed(),
base::TimeDelta::FromMicroseconds(10), base::TimeDelta::FromSeconds(30),
100);
task_runner_->PostTask(FROM_HERE, task_runner_->PostTask(FROM_HERE,
base::BindOnce(&Scheduler::RunNextTask, weak_ptr_)); base::BindOnce(&Scheduler::RunNextTask, weak_ptr_));
} }
......
...@@ -61882,6 +61882,18 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -61882,6 +61882,18 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary> </summary>
</histogram> </histogram>
<histogram name="GPU.Scheduler.RunTaskTime" units="microseconds"
expires_after="2020-12-31">
<owner>kylechar@chromium.org</owner>
<owner>chrome-gpu-metrics@google.com</owner>
<summary>
Records the wall time taken for each GPU scheduler task to run. The time
delta starts when the GPU scheduler pops the task off the task queue and
finishes when the task has completed. Only recorded for clients with high
resolution clocks.
</summary>
</histogram>
<histogram name="GPU.setIsAcceleratedCompositingActive" <histogram name="GPU.setIsAcceleratedCompositingActive"
enum="GPUsetIsAcceleratedCompositingActive" expires_after="M85"> enum="GPUsetIsAcceleratedCompositingActive" expires_after="M85">
<owner>vmiura@chromium.org</owner> <owner>vmiura@chromium.org</owner>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment