From 99d0d0972b794d708bac489ee63b07e4de479d9d Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Sat, 15 Oct 2022 09:52:00 +0800 Subject: [PATCH] still trace pseudo vsync but not create fake ones #6197 --- shell/common/vsync_waiter.cc | 40 +++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/shell/common/vsync_waiter.cc b/shell/common/vsync_waiter.cc index 224bed9c1945f..fa87fc1fc5bc8 100644 --- a/shell/common/vsync_waiter.cc +++ b/shell/common/vsync_waiter.cc @@ -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, @@ -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 -