Search code examples
androidperformance-testingsystrace

Systrace| No "performTraversals" on application thread or no application thread


In this Google IO video, I observed that "performTraversals" is on its application thread(ndroid.slowlist). While in my report, the "performTraversals" is on thread PID 530(android.systemui). And there are only rows representing the activities and dlgs, no thread that explicitly represent my application in the systrace like this one (The last row (10440: m.jv.falcon.pro) representing the application thread) I found online. However, if I do systrace using setting. I could observe a thread representing "android.setting". Can any one tell me why I can not get the application thread for my own application? Thanks a lot!


Solution

  • What exactly went wrong depends on what version of Android you're running and what you did to enable the trace tags.

    Each process has its own copy of the enabled trace tags. If a process doesn't think any tags are enabled, it won't contribute any data to the trace. When the tags are updated, you either need to send a broadcast to all processes (which the developer settings will do if you update them through that interface), or use adb shell stop; adb shell start to restart the framework after the tags are updated. The example in the systrace documentation uses the latter method.

    So it looks like the systemui process saw the updated tags ("gfx" and "view") but somehow your app process didn't. I would expect that, if you went through all of the steps in the systrace doc (set tags with python script, restart framework, launch app, capture trace), it would work.