New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSYNC trace event ending prematurely #115161
Comments
Possibly due to flutter/engine#36775 Are you able to try reverting that and seeing if it gets better? |
@fzyzcjy fyi |
For repro steps, I was seeing this consistently when I would turn the Performance Overlay on and off. |
Hmm, here are possible solutions:
|
@kenzieschmoll - what's the impact of this? I suspect wha'ts happening here is that we're emitting past-dated vsync events sometimes. Is this causing something wrong in devtools? |
Yes this violates the requirements of the Chrome Trace Event Format for Duration (synchronous) events, and causes an unbalanced tree in DevTools when composing trace events into a tree format. |
If the VYSNC event really should finish before its children, should it be an Async event? ('b' and 'e' instead of 'B' and 'E') |
We should revert for now - flutter/engine#37589 |
IIRC, no, unfortunately. I have tried to be async initially, and then it is not recognized by chrome://tracing at all. I have checked chrome://tracing's source code and IIRC it requires sync events. So, shall we use the alternative approach: create that event in a dummy thread id (i.e. not-existent thread)? |
chrome://tracing (and the new and improved Perfetto trace viewer), and Dart DevTools all support async events for the Chrome Trace Event Format, so it is fine to use async events. The flutter framework / engine sends several async events to the timeline. |
@kenzieschmoll Yes I know it allows async events, but have you tried whether the async VSYNC event is allowed (hope it is allowed!)? Last time (a month ago?) I tried it and it is not. In other words, the VSYNC event is there, but there is no zebra colors at all and chrome just think it is a normal event instead of the special vsync event and colorize the figure. |
@fzyzcjy at this point I think we'd prioritize the devtools experience over making sure that |
+1 to Dan's comment. @fzyzcjy what are you trying to accomplish with chrome://tracing that you can't accomplish with Flutter DevTools? (we are also actively working on improving the trace viewing experience in DevTools, if you are noticing performance or usability issues with that trace viewer) |
Which I guess are not solveable by devtool indeed :/ |
Problem of the revert: The current revert makes the VSYNC completely wrong (which is described in my PR before). i.e. The start of VSYNC interval does not mean the vsync is at that time at all! Therefore, it looks meaningless and confusing to look at the tracing data. For example, if something has exceeded/not-exceed the vsync timestamp but the tracing data wrongly reports the reverse, all logical reasoning will be wrong. "Does something exceed vsync" is very much needed when I develop https://github.com/fzyzcjy/flutter_smooth, because I need to check and debug whether the actual code satisfies my theoretical timeline. An example "theoretical timeline" can be seen everywhere in the doc, e.g. the colorful figure https://cjycode.com/flutter_smooth/design/infra/rasterizer-queue/remove-jank. |
Alternative solutions to the PR:
|
I think as long as we don't break devtools we should be fine :) Ideally though, we'd avoid emitting any unnecessary events every frame - i.e. there may not be a good reason to emit both the |
Given that, maybe the 2nd approach looks better? :) |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
The VSYNC end event is coming in out of order. Here is an example with (event name - phase - timestamp):
These are Synchronous events so the VSYNC event should not be finishing until all its children do. Are we missing an await somewhere?
@jonahwilliams @dnfield
The text was updated successfully, but these errors were encountered: