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
Add flutter frame identifier to timeline events on UI and Raster threads #80735
Comments
@kenzieschmoll is there any reason not to go with the frame-janks-are-errors design of have the framework plumb through the frame identifier? If not, I can wire that up fairly quickly.... |
would this result in both the UI root event and the Raster root event having the identifier in their trace events? |
Yes, the information should be available in the engine when we write the traces. I didn't wire that up in the prototype but can't imagine it would be that hard (famous last words) |
Then that sounds like exactly what we need. |
Capturing the offline discussion with @jonahwilliams: I like the idea of having a frame identifier that is associated with trace events. Given that engine triggers the frame build and raster process, it would be best if engine does the creation and managing lifecycle of the said frame identifier. Next steps are for Jonah and I to iterate on flutter/engine#25662. |
Another use for this would be flutter/devtools#2943 |
To meet this use case, the starting frame number would need to be consistent (0-based or 1-based) so we can identify the first frame for an app run. |
`FlutterFrameTimingsRecorder` is passed through the lifecycle of the frame and records the events that happen through it. This also serves as a builder for the `FrameTiming` object that is later passed to the framework. This change also aims to lay the foundation to capture a unique frame identifier which will later be added to `FlutterFrameTimingsRecorder` to identify the trace events corresponding to each frame. x-ref: #25662 x-ref: flutter/flutter#80735
`FlutterFrameTimingsRecorder` is passed through the lifecycle of the frame and records the events that happen through it. This also serves as a builder for the `FrameTiming` object that is later passed to the framework. This change also aims to lay the foundation to capture a unique frame identifier which will later be added to `FlutterFrameTimingsRecorder` to identify the trace events corresponding to each frame. x-ref: flutter#25662 x-ref: flutter/flutter#80735
`FlutterFrameTimingsRecorder` is passed through the lifecycle of the frame and records the events that happen through it. This also serves as a builder for the `FrameTiming` object that is later passed to the framework. This change also aims to lay the foundation to capture a unique frame identifier which will later be added to `FlutterFrameTimingsRecorder` to identify the trace events corresponding to each frame. x-ref: flutter#25662 x-ref: flutter/flutter#80735
`FlutterFrameTimingsRecorder` is passed through the lifecycle of the frame and records the events that happen through it. This also serves as a builder for the `FrameTiming` object that is later passed to the framework. This change also aims to lay the foundation to capture a unique frame identifier which will later be added to `FlutterFrameTimingsRecorder` to identify the trace events corresponding to each frame. x-ref: flutter#25662 x-ref: flutter/flutter#80735
`FlutterFrameTimingsRecorder` is passed through the lifecycle of the frame and records the events that happen through it. This also serves as a builder for the `FrameTiming` object that is later passed to the framework. This change also aims to lay the foundation to capture a unique frame identifier which will later be added to `FlutterFrameTimingsRecorder` to identify the trace events corresponding to each frame. x-ref: flutter#25662 x-ref: flutter/flutter#80735
`FlutterFrameTimingsRecorder` is passed through the lifecycle of the frame and records the events that happen through it. This also serves as a builder for the `FrameTiming` object that is later passed to the framework. This change also aims to lay the foundation to capture a unique frame identifier which will later be added to `FlutterFrameTimingsRecorder` to identify the trace events corresponding to each frame. x-ref: flutter#25662 x-ref: flutter/flutter#80735
`FlutterFrameTimingsRecorder` is passed through the lifecycle of the frame and records the events that happen through it. This also serves as a builder for the `FrameTiming` object that is later passed to the framework. This change also aims to lay the foundation to capture a unique frame identifier which will later be added to `FlutterFrameTimingsRecorder` to identify the trace events corresponding to each frame. x-ref: flutter#25662 x-ref: flutter/flutter#80735
flutter/engine#25892 and flutter/engine#26021 partially address the issue. Per my conversations with @jonahwilliams and @kenzieschmoll , the next AIs are:
Thanks and let me know if I'm missing something here. |
Interestingly, the frame numbers don't seem to be incrementing by 1. In this example they are increasing by 3 - is that expected? @iskakaushik @jonahwilliams |
That is surprising to me at least :) |
I saw it alternating each time, 1, 3, 5... This PR should fix it: flutter/engine#26513. At least locally after this change I'm seeing every number appear. |
What is left to do for this? |
I think this is complete. |
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 |
In DevTools, we need a way to connect Flutter.Frame events (sent here) to their corresponding timeline events on the UI and Raster threads. This is a requirement in order to make the DevTools timeline show live frame data.
We cannot connect a Flutter.Frame event to its corresponding timeline events by timestamp because the two data sources use different clocks. From @iskakaushik:
If we could add metadata to the root UI thread and root Raster thread event that would allow us to associate those two timeline events with a Flutter.Frame event, that would work. Perhaps adding an arg "frameNumber" that matches the "number" field from Flutter.Frame events.
The text was updated successfully, but these errors were encountered: