Commit 5538429b authored by behdad's avatar behdad Committed by Commit Bot

Report Missedframe only in case of Not Present Frame and/or Replaced

Missedframe histograms are for the case that we do not present frame or
replaced a reporter by another.
Unit test is updated to reflect this change.



Bug: chromium:1010927
Change-Id: I0b1dd14d53ba7d17bfa92db6261e3cce6e2da8d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1836987
Commit-Queue: Behdad Bakhshinategh <behdadb@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarBehdad Bakhshinategh <behdadb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703325}
parent 9116a2f1
......@@ -170,12 +170,16 @@ void CompositorFrameReporter::TerminateReporter() {
termination_status_str = "presented_frame";
break;
case FrameTerminationStatus::kDidNotPresentFrame:
report_latency = true;
MissedSubmittedFrame();
termination_status_str = "did_not_present_frame";
break;
case FrameTerminationStatus::kMainFrameAborted:
termination_status_str = "main_frame_aborted";
break;
case FrameTerminationStatus::kReplacedByNewReporter:
report_latency = true;
MissedSubmittedFrame();
termination_status_str = "replaced_by_new_reporter_at_same_stage";
break;
case FrameTerminationStatus::kDidNotProduceFrame:
......
......@@ -130,14 +130,6 @@ void CompositorFrameReportingController::DidSubmitCompositorFrame(
return;
std::unique_ptr<CompositorFrameReporter> submitted_reporter =
std::move(reporters_[PipelineStage::kActivate]);
// If there are any other reporters active on the other stages of the
// pipeline then that means a new frame was started during the duration of
// this reporter and therefore the frame being tracked missed the deadline.
if (reporters_[PipelineStage::kBeginImplFrame] ||
reporters_[PipelineStage::kBeginMainFrame] ||
reporters_[PipelineStage::kCommit]) {
submitted_reporter->MissedSubmittedFrame();
}
submitted_reporter->StartStage(
CompositorFrameReporter::StageType::
kSubmitCompositorFrameToPresentationCompositorFrame,
......
......@@ -173,41 +173,37 @@ TEST_F(CompositorFrameReportingControllerTest,
// 2 reporters active.
SimulateActivate();
SimulateBeginImplFrame();
SimulateCommit();
// Submitting and Presenting the next reporter should be a missed.
// Submitting and Presenting the next reporter which will be a normal frame.
SimulatePresentCompositorFrame();
histogram_tester.ExpectTotalCount(
"CompositorLatency.MissedFrame.BeginImplFrameToSendBeginMainFrame", 1);
"CompositorLatency.MissedFrame.BeginImplFrameToSendBeginMainFrame", 0);
histogram_tester.ExpectTotalCount(
"CompositorLatency.MissedFrame.SendBeginMainFrameToCommit", 1);
histogram_tester.ExpectTotalCount("CompositorLatency.MissedFrame.Commit", 1);
"CompositorLatency.MissedFrame.SendBeginMainFrameToCommit", 0);
histogram_tester.ExpectTotalCount("CompositorLatency.MissedFrame.Commit", 0);
histogram_tester.ExpectTotalCount(
"CompositorLatency.MissedFrame.EndCommitToActivation", 1);
"CompositorLatency.MissedFrame.EndCommitToActivation", 0);
histogram_tester.ExpectTotalCount("CompositorLatency.MissedFrame.Activation",
1);
0);
histogram_tester.ExpectTotalCount(
"CompositorLatency.MissedFrame.EndActivateToSubmitCompositorFrame", 1);
// Other histograms should not be reported.
"CompositorLatency.MissedFrame.EndActivateToSubmitCompositorFrame", 0);
histogram_tester.ExpectTotalCount(
"CompositorLatency.BeginImplFrameToSendBeginMainFrame", 0);
"CompositorLatency.BeginImplFrameToSendBeginMainFrame", 1);
histogram_tester.ExpectTotalCount(
"CompositorLatency.SendBeginMainFrameToCommit", 0);
histogram_tester.ExpectTotalCount("CompositorLatency.Commit", 0);
"CompositorLatency.SendBeginMainFrameToCommit", 1);
histogram_tester.ExpectTotalCount("CompositorLatency.Commit", 1);
histogram_tester.ExpectTotalCount("CompositorLatency.EndCommitToActivation",
0);
histogram_tester.ExpectTotalCount("CompositorLatency.Activation", 0);
1);
histogram_tester.ExpectTotalCount("CompositorLatency.Activation", 1);
histogram_tester.ExpectTotalCount(
"CompositorLatency.EndActivateToSubmitCompositorFrame", 0);
"CompositorLatency.EndActivateToSubmitCompositorFrame", 1);
// Submitting the next reporter will not be counted as missed.
// In practice this submitted frame should be considered as missed because a
// new BeginFrame would have been issued, which is the cause for this frame
// submission.
SimulatePresentCompositorFrame();
// Other histograms should not be reported.
// Submitting the next reporter will be replaced as a result of a new commit.
// And this will be reported for all stage before activate as a missed frame.
SimulateCommit();
// Non Missed frame histogram counts should not change.
histogram_tester.ExpectTotalCount(
"CompositorLatency.BeginImplFrameToSendBeginMainFrame", 1);
histogram_tester.ExpectTotalCount(
......@@ -219,7 +215,7 @@ TEST_F(CompositorFrameReportingControllerTest,
histogram_tester.ExpectTotalCount(
"CompositorLatency.EndActivateToSubmitCompositorFrame", 1);
// Missed frame histogram counts should not change.
// Other histograms should be reported updated.
histogram_tester.ExpectTotalCount(
"CompositorLatency.MissedFrame.BeginImplFrameToSendBeginMainFrame", 1);
histogram_tester.ExpectTotalCount(
......@@ -228,9 +224,9 @@ TEST_F(CompositorFrameReportingControllerTest,
histogram_tester.ExpectTotalCount(
"CompositorLatency.MissedFrame.EndCommitToActivation", 1);
histogram_tester.ExpectTotalCount("CompositorLatency.MissedFrame.Activation",
1);
0);
histogram_tester.ExpectTotalCount(
"CompositorLatency.MissedFrame.EndActivateToSubmitCompositorFrame", 1);
"CompositorLatency.MissedFrame.EndActivateToSubmitCompositorFrame", 0);
}
} // namespace
} // namespace cc
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