Combining different profile configuration data from Android device in Unity application

59 Views Asked by At

I'm having a task to understand why long-time developing Unity application launches too slow on Android device. I need information about the whole launching time so I decided to use Android Studio's profiling tools instead of Unity profiler (It can't show me information about native SDK's like Facebook, Firebase etc. + it's so unstable when I want to get profiling data right after the app launch).

There is a very handy 'callstack sample' mode to see what's happening on CPU, but profiler makes app loading more slowly so I can't understand exactly what part of calls really slow and what part is slowing down by profiler. I tried 'system trace' mode where I can add custom markers by using Trace API. Now I can see my timeline markers and have ability to compare no-profiling build with profiling one to understand profiler caused consumption overhead for some periods (like activity creation, Unity engine initialization, scene loading, resolving Di dependencies etc.). But in that mode I can't investigate stacktrace and see only my and another not really useful markers.

The question is how can I combine that profiling modes to see callstack and system trace or how can I mark some application life-time events directly in callstack mode ?

I understand that that's different profiling modes and possibly it can't be done at all but I'm new in Android profiling and maybe you know some tricks because I can't easily compare callstack and system trace files.

Thanks.

1

There are 1 best solutions below

1
Pavlo Supenko On

Unfortunately it's seems to be no way to easily combine system trace and callstack files. So I manually compared two file. To get two files from one launch I started trace file creation on device using developer options and after that I started profiling in Android Studio with callstack mode. Then I compared them in Android Studio and Perfetto UI and got information what I need.