-
Notifications
You must be signed in to change notification settings - Fork 381
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
feature: relax requirements for emitting clock snapshots #1000
Comments
I've commented on the patch but basically we need to
|
Yes, I saw your comment. I looked at the sorting code in more detail yesterday so I understand that better now and you're comment and suggestion makes sense. I'll update the patch as suggested asap. |
Latest version of patch that was merged works with some of the conversion tools and passes the added unit tests but doesn't fully work with the UI. This is because events that are deferred to EOF will be dropped by the trace processor as it currently Flush, which implies forced sorting and extraction of events just before calling NotifyEndOfFile(). https://android-review.googlesource.com/c/platform/external/perfetto/+/3505773 is a WIP change that should fix this. |
ClockSnapshot packet currently must be emitted before the custom clock is referred to by any TracePacket written by the same TraceWriter
Removing this requirement makes custom clocks easier to use and enables the use-case described below.
Cycle accurate simulator
Cycle accurate simulators advance one or more cycle counters internally when executing workloads. The cycle number is technically the clock that is used to determine performance and what the user of the simulator cares about. This cycle counter doesn't map to the trace time in a predetermined way. The simulator might take a long time to simulate something that takes only a cycle on real hardware, and a short time to simulate something that is really expensive on real hardware. Being able to visualize simulator work based on the cycle count allows perfetto to be used instead of alternative tools to visualize workloads running on simulators. It's also allowing the work to be connected to host side events, which makes it much easier to understand the overall flow of an application.
We need to map events that uses the cycle count to the trace clock. Custom clocks works well except for the requirement that clock snapshots needs to be emitted before track events referring to the clock. The problem is that we don't know how what the unit multiplier for the cycle clock is until the interval that we want to map to trace time has completed. Being able to emit clock snapshots when the interval ends solves this problem.
Alternatives
The text was updated successfully, but these errors were encountered: