Commit f6a6e0b1 authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

Exclude invalid timestamp data for PresentationTimeRecorder

It turns out that timestamp data for the PresentationFeedback
is not set on some board, which makes the delta value to be
negative.

This should be errors and should not report data points.

Bug: b/165951963
Test: tast.ui.LauncherDragPerf on lazor to see failures
Change-Id: Ie04e57d173601a827d581eb51918a2471c82fc94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2373262
Commit-Queue: Jun Mukai <mukai@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801434}
parent e2a05ccc
......@@ -143,6 +143,7 @@ bool PresentationTimeRecorder::PresentationTimeRecorderInternal::RequestNext() {
if (report_immediately_for_test) {
state_ = COMMITTED;
gfx::PresentationFeedback feedback;
feedback.timestamp = now;
OnPresented(request_count_++, now, feedback);
return true;
}
......@@ -170,7 +171,20 @@ void PresentationTimeRecorder::PresentationTimeRecorderInternal::OnPresented(
<< ", flags=" << ToFlagString(feedback.flags);
return;
}
if (feedback.timestamp.is_null()) {
// TODO(b/165951963): ideally feedback.timestamp should not be null.
// Consider replacing this by DCHECK or CHECK.
LOG(ERROR) << "Invalid feedback timestamp (" << count << "):"
<< " timestamp is not set";
return;
}
const base::TimeDelta delta = feedback.timestamp - requested_time;
if (delta.InMilliseconds() < 0) {
LOG(ERROR) << "Invalid timestamp for presentation feedback (" << count
<< "): requested_time=" << requested_time
<< " feedback.timestamp=" << feedback.timestamp;
return;
}
if (delta.InMilliseconds() > max_latency_ms_)
max_latency_ms_ = delta.InMilliseconds();
......
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