firefox-devtools / profiler

Firefox Profiler — Web app for Firefox performance analysis
https://profiler.firefox.com
Mozilla Public License 2.0
1.21k stars 393 forks source link

Support importing simpleperf trace files from Android Studio #5203

Open nisargjhaveri opened 5 days ago

nisargjhaveri commented 5 days ago

Is it possible to add support for simpleperf trace files generated using Android Studio or simpleperf report-sample commands.

Here is the file format details: https://cs.android.com/android/platform/superproject/main/+/main:system/extras/simpleperf/cmd_report_sample.proto

I can help create a PR if it makes sense to add this support here.

┆Issue is synchronized with this Jira Task

julienw commented 4 days ago

Sure, why not!

canova commented 4 days ago

I thought we had support for the simpleperf already. I found a documentation here: https://profiler.firefox.com/docs/#/./guide-android-profiling?id=perf-profiling-on-android

Have you tried these steps here?

julienw commented 4 days ago

I believe it's not the same type of simpleperf output here. The trace format seems to be binary. I don't know how easy it will be to import it! but it's worth trying if you want :-)

nisargjhaveri commented 2 days ago

I've made an attempt in #5212. Feel free to suggest any changes as required. :)

@canova, yes those steps works when using simpleperf directly to record profiles and we have the raw perf.data file to work with. But simpleperf also provides another utility to convert perf.data to this particular format via simpleperf report-sample, while taking care of symbolication etc. One benefit of doing this is reduced external dependency on python as ./gecko_profile_generator.py would require that.

Also, when generating profiles from Android Studio, it directly exports profiles into this format and gecko_profile_generator.py does not help in that case anyway.