Skip to content

Commit

Permalink
still trace pseudo vsync but not create fake ones flutter#6197
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Oct 15, 2022
1 parent 04989e8 commit 99d0d09
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 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,9 +232,11 @@ void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time,
// #6197
fml::TimeDelta::FromMilliseconds(3));

// // for debug #5988
// // use the name "VSYNC" since #6049
// TracePseudoVsync(frame_start_time, frame_target_time);
// 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 -
// frame_start_time; for (fml::TimePoint t = frame_target_time -
Expand Down

0 comments on commit 99d0d09

Please sign in to comment.