Systrace custom events not showing in release build of app

717 Views Asked by At

I am using systrace/perfetto to capture traces. I am following below way to add custom events from my code - https://developer.android.com/topic/performance/tracing/custom-events

I can see custom events in debug build but cant see in release build.

Is there anyway by which i can see custom events in release build of my app

3

There are 3 best solutions below

4
On

I think making your release build debuggable will do the trick. add following in your app module build.gradle file

  buildTypes {
    release {
        debuggable true
    }
}
0
On

Starting in Android API 29 (Q), there's a new profileable flag in the manifest that enables some profiling data (e.g. systrace custom events) for non-debuggable builds.

0
On

Have you added the package name of your app, when you are capturing the trace. You can specify it by -a tag. Adding a package name is mandatory to see custom events in a release build.

for eg :

python systrace.py -o trace_file.html -a package_name sched freq idle am wm gfx view binder_driver hal dalvik camera input res