Skip to content

Commit

Permalink
minor change logging to expose more data flutter#6197
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Oct 15, 2022
1 parent 99d0d09 commit c482b39
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions shell/common/vsync_waiter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,22 @@ void VsyncWaiter::ScheduleSecondaryCallback(uintptr_t id,
AwaitVSyncForSecondaryCallback();
}

void TracePseudoVsync(fml::TimePoint start, fml::TimePoint end) {
// not working
// https://github.com/fzyzcjy/yplusplus/issues/6049#issuecomment-1270892321
// fml::tracing::TraceEventAsyncComplete("flutter", "VSYNC",
// frame_start_time,
// frame_target_time);

// ref [TraceEvent0]
fml::tracing::TraceTimelineEvent("flutter", "VSYNC",
start.ToEpochDelta().ToMicroseconds(), 0,
Dart_Timeline_Event_Begin, {}, {});
// ref [TraceEventEnd]
fml::tracing::TraceTimelineEvent("flutter", "VSYNC",
end.ToEpochDelta().ToMicroseconds(), 0,
Dart_Timeline_Event_End, {}, {});
}
// void TracePseudoVsync(fml::TimePoint start, fml::TimePoint end) {
// // not working
// // https://github.com/fzyzcjy/yplusplus/issues/6049#issuecomment-1270892321
// // fml::tracing::TraceEventAsyncComplete("flutter", "VSYNC",
// // frame_start_time,
// // frame_target_time);
//
// // ref [TraceEvent0]
// fml::tracing::TraceTimelineEvent("flutter", "VSYNC",
// start.ToEpochDelta().ToMicroseconds(), 0,
// Dart_Timeline_Event_Begin, {}, {});
// // ref [TraceEventEnd]
// fml::tracing::TraceTimelineEvent("flutter", "VSYNC",
// end.ToEpochDelta().ToMicroseconds(), 0,
// Dart_Timeline_Event_End, {}, {});
// }

void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time,
fml::TimePoint frame_target_time,
Expand Down Expand Up @@ -232,10 +232,18 @@ void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time,
// #6197
fml::TimeDelta::FromMilliseconds(3));

// ref [TraceEvent0], [TraceEventEnd]
fml::tracing::TraceTimelineEvent(
"flutter", "VSYNC", frame_start_time.ToEpochDelta().ToMicroseconds(), 0,
Dart_Timeline_Event_Begin, {"frame_start_time", "frame_target_time"},
{std::to_string(frame_start_time.ToEpochDelta().ToMicroseconds()),
std::to_string(frame_target_time.ToEpochDelta().ToMicroseconds())});
fml::tracing::TraceTimelineEvent(
"flutter", "VSYNC", frame_target_time.ToEpochDelta().ToMicroseconds(), 0,
Dart_Timeline_Event_End, {}, {});

// for debug #5988
// use the name "VSYNC" since #6049
TracePseudoVsync(frame_start_time, frame_target_time);

// commented out in #6197
// if (last_timeline_report_vsync_target_time_.has_value()) {
// fml::TimeDelta rough_frame_duration = frame_target_time -
Expand Down

0 comments on commit c482b39

Please sign in to comment.