Commit bcf241dc authored by Sadrul Habib Chowdhury's avatar Sadrul Habib Chowdhury Committed by Commit Bot

[cc/metrics] More trace fixes.

It is possible to start new stages after a frame has been marked
as 'did not produce frame'. Sometimes these reports can go on and
produce frames (e.g. if the main-thread comes back late after the
deadline). However, in other times, the reporters can terminate as
'did not produce frame'. For such frames, do not report the stages
that started after the initial 'did not produce' notification.

BUG=1074567
TBR=behdadb@chromium.org

Change-Id: I4d45372d8a973247fb129c0964776179d9f009e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2167174Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Auto-Submit: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#762699}
parent cbec4169
...@@ -670,6 +670,11 @@ void CompositorFrameReporter::ReportAllTraceEvents( ...@@ -670,6 +670,11 @@ void CompositorFrameReporter::ReportAllTraceEvents(
const int stage_type_index = static_cast<int>(stage.stage_type); const int stage_type_index = static_cast<int>(stage.stage_type);
CHECK_LT(stage_type_index, static_cast<int>(StageType::kStageTypeCount)); CHECK_LT(stage_type_index, static_cast<int>(StageType::kStageTypeCount));
CHECK_GE(stage_type_index, 0); CHECK_GE(stage_type_index, 0);
if (stage.start_time >= frame_termination_time_)
break;
DCHECK_GE(stage.end_time, stage.start_time);
if (stage.start_time == stage.end_time)
continue;
const char* name = GetStageName(stage_type_index); const char* name = GetStageName(stage_type_index);
TRACE_EVENT_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0( TRACE_EVENT_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0(
"cc,benchmark", name, trace_id, stage.start_time); "cc,benchmark", name, trace_id, stage.start_time);
...@@ -711,10 +716,9 @@ void CompositorFrameReporter::ReportAllTraceEvents( ...@@ -711,10 +716,9 @@ void CompositorFrameReporter::ReportAllTraceEvents(
TestReportType(FrameReportType::kDroppedFrame) ? "dropped_frame" TestReportType(FrameReportType::kDroppedFrame) ? "dropped_frame"
: "non_dropped_frame"; : "non_dropped_frame";
TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP2( TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP2(
"cc,benchmark", "PipelineReporter", trace_id, "cc,benchmark", "PipelineReporter", trace_id, frame_termination_time_,
stage_history_.back().end_time, "termination_status", "termination_status", termination_status_str,
termination_status_str, "compositor_frame_submission_status", "compositor_frame_submission_status", submission_status_str);
submission_status_str);
} }
base::TimeDelta CompositorFrameReporter::SumOfStageHistory() const { base::TimeDelta CompositorFrameReporter::SumOfStageHistory() 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