Commit d15ba9ba authored by Fady Samuel's avatar Fady Samuel Committed by Commit Bot

Surface synchronization: Don't report blocked duration of throttled children

A child can be "throttled" for an arbitrary length of time if it is never
embedded. This skews blocked duration metrics. Simply don't report those
metrics if a surface is blocked on a parent.

Bug: 890767
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: I3c8a8494a5b1e5a973b2e5c2b61cffe5c2b76f6f
Reviewed-on: https://chromium-review.googlesource.com/c/1274591
Commit-Queue: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: default avatarSaman Sami <samans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598886}
parent 416efd39
...@@ -198,6 +198,11 @@ void Surface::OnSurfaceDependencyAdded() { ...@@ -198,6 +198,11 @@ void Surface::OnSurfaceDependencyAdded() {
DCHECK(frame_sink_id_dependencies_.empty()); DCHECK(frame_sink_id_dependencies_.empty());
// Cancel the deadline and don't report UMA. The UMA metrics are only
// meaningful for activation dependencies and not throttling.
deadline_->CancelWithoutReport();
DCHECK(!deadline_->has_deadline());
// All blockers have been cleared. The surface can be activated now. // All blockers have been cleared. The surface can be activated now.
ActivatePendingFrame(base::nullopt); ActivatePendingFrame(base::nullopt);
} }
......
...@@ -41,6 +41,13 @@ base::Optional<base::TimeDelta> SurfaceDependencyDeadline::Cancel() { ...@@ -41,6 +41,13 @@ base::Optional<base::TimeDelta> SurfaceDependencyDeadline::Cancel() {
return CancelInternal(false); return CancelInternal(false);
} }
void SurfaceDependencyDeadline::CancelWithoutReport() {
if (!deadline_)
return;
begin_frame_source_->RemoveObserver(this);
deadline_.reset();
}
void SurfaceDependencyDeadline::InheritFrom( void SurfaceDependencyDeadline::InheritFrom(
const SurfaceDependencyDeadline& other) { const SurfaceDependencyDeadline& other) {
if (*this == other) if (*this == other)
...@@ -96,8 +103,7 @@ base::Optional<base::TimeDelta> SurfaceDependencyDeadline::CancelInternal( ...@@ -96,8 +103,7 @@ base::Optional<base::TimeDelta> SurfaceDependencyDeadline::CancelInternal(
if (!deadline_) if (!deadline_)
return base::nullopt; return base::nullopt;
begin_frame_source_->RemoveObserver(this); CancelWithoutReport();
deadline_.reset();
base::TimeDelta duration = tick_clock_->NowTicks() - start_time_; base::TimeDelta duration = tick_clock_->NowTicks() - start_time_;
......
...@@ -36,6 +36,12 @@ class VIZ_SERVICE_EXPORT SurfaceDependencyDeadline : public BeginFrameObserver { ...@@ -36,6 +36,12 @@ class VIZ_SERVICE_EXPORT SurfaceDependencyDeadline : public BeginFrameObserver {
// deadline set, then return base::nullopt. // deadline set, then return base::nullopt.
base::Optional<base::TimeDelta> Cancel(); base::Optional<base::TimeDelta> Cancel();
// If a deadline had been set, then cancel the deadline and don't
// generate a UMA report. When a surface activation has been throttled
// then the time to activation could be arbitrarily delayed and may
// skew metrics.
void CancelWithoutReport();
bool has_deadline() const { return deadline_.has_value(); } bool has_deadline() const { return deadline_.has_value(); }
base::Optional<base::TimeTicks> deadline_for_testing() const { base::Optional<base::TimeTicks> deadline_for_testing() const {
......
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