-
Notifications
You must be signed in to change notification settings - Fork 6k
Highlight VSync support for embedders #25247
Highlight VSync support for embedders #25247
Conversation
Chrome Trace viewer treats events labeled "VSYNC" as special and highlights them (when the "Highlight Vsync" checkbox is enabled). Ideally VSYNC events are generated by the host system at their source. System VSYNC events are indeed present in full-system systraces. Flutter-level traces (as seen in Observatory/Flutter devtools) do not contain the system VSYNC events, so we rely on the engine to generate them (as close to where they would be generated by the system ideally).
chinmaygarde
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also suggest (in another patch is fine) adding this trace around embedder provided vsync callback trampolines. That way, all existing embedders that wire up vsync correctly instead of falling back to a timer will get this well.
The only argument I can think of against doing this for embedder is if they want to do it themselves via FlutterEngineTraceEventInstant().
|
|
||
| // |VsyncWaiter| | ||
| void VsyncWaiterFallback::AwaitVSync() { | ||
| TRACE_EVENT0("flutter", "VSYNC"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be a TRACE_INSTANT0. It is not meant to be a slice I don't think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was following what's being done on: https://github.com/flutter/engine/blob/master/shell/platform/android/vsync_waiter_android.cc#L47 and https://github.com/flutter/engine/blob/master/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm#L71 as I wasn't sure how catapult expects these. I will investigate changing it to an instant.
Chrome Trace viewer treats events labeled "VSYNC" as special and highlights them (when the "Highlight Vsync" checkbox is enabled). Ideally VSYNC events are generated by the host system at their source. System VSYNC events are indeed present in full-system systraces. Flutter-level traces (as seen in Observatory/Flutter devtools) do not contain the system VSYNC events, so we rely on the engine to generate them (as close to where they would be generated by the system ideally).
Chrome Trace viewer treats events labeled "VSYNC" as special and highlights them (when the "Highlight Vsync" checkbox is enabled). Ideally VSYNC events are generated by the host system at their source. System VSYNC events are indeed present in full-system systraces. Flutter-level traces (as seen in Observatory/Flutter devtools) do not contain the system VSYNC events, so we rely on the engine to generate them (as close to where they would be generated by the system ideally).
Chrome Trace viewer treats events labeled "VSYNC" as special and highlights them (when the "Highlight Vsync" checkbox is enabled). We do this for ios and android already, this PR also does this for fallback vsync waiters which are used by embedders by default.