Description
Currently, the flutter devtools are very helpful for profiling & tracing flutter applications. However, sometimes, the information provided by the devtools is not enough to find potential bottlenecks.
Perfetto is a perfect solution to trace the whole system and really see what every process & thread is doing. E.g. there's data producers for process scheduling, syscalls, CPU frequency and DMA fences. The DMA fence tracing is especially useful to see how long rendering actually took on the GPU. Furthermore, there's perfetto integration in mesa to trace raw GPU performance counters and stuff like command buffer submits.
Dart/Flutter even already kinda has some perfetto support, but only for generating one-off trace files, and combining that with other data sources does not really work (leads to broken trace files).
There's also a systrace
backend you can enable with --trace-systrace
, which writes to /sys/kernel/tracing/trace_marker
on linux. However, AFAICT, perfetto is not able to recognize the trace events written there.
So the proposal is: Add a tracing backend to Flutter (/ Dart) that traces to the perfetto system deamon, instead of to files