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!
-
With the "view" tag enabled, you should see traces for any thread that is exercising the view hierarchy. It looks like you've got rows for surfaceflinger (pid 126) and various buffer queues, plus a bit for systemui, but no app data. Can you confirm that the app was actively used during the trace? You won't get rows for threads that don't do anything. – fadden Jul 31 '13 at 20:59
-
Hi! Fadden, the app was active during the trace. And you can observe from my report that I went over several activities and even opened a dialog (AtchDlg column). I guess that will require the traversal of the view tree? – Wei Yang Jul 31 '13 at 22:20
1 Answers
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.

- 51,356
- 5
- 116
- 166
-
Hi! Fadden. Thanks for pointing out broadcasting tag changes, I think that's why the application thread disappear. I'm unable to use python script for the problem I met in [this](http://stackoverflow.com/questions/17851191/android-systrace-no-such-file-or-directory/17860895) thread. I'm using Nexus 7 now so I can use systrace tool on DDMS. However, after selecting tags and click OK, it seems that it haven't broadcast to application process. (I assume it's a bug in DDMS?) Manually select these tags in developer option will solve this issue. – Wei Yang Aug 01 '13 at 00:34
-
I added a note to the other thread -- the systrace-legacy.py script is now included in the SDK tools, but it moved to a different directory. What version of Android are you running on your device? Android 4.3 should be much easier to work with than older releases. – fadden Aug 01 '13 at 04:54