Skip to content

Commit

Permalink
Remove SceneDisplayLag trace event temporarily (flutter#17571)
Browse files Browse the repository at this point in the history
Working theory is that adding async events with begin times
in the past causes the timeline to skip some events.

See: flutter/flutter#54095
  • Loading branch information
iskakaushik authored Apr 7, 2020
1 parent c2ffe61 commit 1b6b609
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions shell/common/rasterizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ RasterStatus Rasterizer::DoDraw(
}

FrameTiming timing;
const fml::TimePoint frame_target_time = layer_tree->target_time();
timing.Set(FrameTiming::kBuildStart, layer_tree->build_start());
timing.Set(FrameTiming::kBuildFinish, layer_tree->build_finish());
timing.Set(FrameTiming::kRasterStart, fml::TimePoint::Now());
Expand Down Expand Up @@ -272,32 +271,6 @@ RasterStatus Rasterizer::DoDraw(
timing.Set(FrameTiming::kRasterFinish, raster_finish_time);
delegate_.OnFrameRasterized(timing);

if (raster_finish_time > frame_target_time) {
fml::TimePoint latest_frame_target_time =
delegate_.GetLatestFrameTargetTime();
const auto frame_budget_millis = delegate_.GetFrameBudget().count();
if (latest_frame_target_time < raster_finish_time) {
latest_frame_target_time =
latest_frame_target_time +
fml::TimeDelta::FromMillisecondsF(frame_budget_millis);
}
const auto frame_lag =
(latest_frame_target_time - frame_target_time).ToMillisecondsF();
const int vsync_transitions_missed = round(frame_lag / frame_budget_millis);
fml::tracing::TraceEventAsyncComplete(
"flutter", // category
"SceneDisplayLag", // name
frame_target_time, // begin_time
raster_finish_time, // end_time
"frame_target_time", // arg_key_1
frame_target_time, // arg_val_1
"current_frame_target_time", // arg_key_2
latest_frame_target_time, // arg_val_2
"vsync_transitions_missed", // arg_key_3
vsync_transitions_missed // arg_val_3
);
}

// Pipeline pressure is applied from a couple of places:
// rasterizer: When there are more items as of the time of Consume.
// animator (via shell): Frame gets produces every vsync.
Expand Down

0 comments on commit 1b6b609

Please sign in to comment.