(I would have added this as a comment to @ron’s answer, but my reputation is still not high enough that I can comment ;)).
Since July 2011, you can in fact get traceview and VMDebug to give you wall clock time as well as cpu usage time, thanks to a code change by Jeff Brown. I’m afraid the necessary permissions require a rooted device however. This also leads to a slightly different traceview window than the post by tjb above.
http://git.insignal.co.kr/?p=mirror/aosp/platform/dalvik.git;a=commitdiff;h=9f640af99bebc6e96f6e1e9903557e2c8f567483
TLDR; adb shell setprop dalvik.vm.extra-opts -Xprofile:dualclock
and reboot your device.
HRM, since I’m technically supposed to help answer the question:
-
My understanding of the heights of bars is that it’s related to parent functions. Suppose a() calls b(). Then a() is running while b() is also running. While b() is running traceview will show b’s color; but when a is running (i.e. excl time) it will draw a’s color, and it will draw a’s bar slightly higher than b’s bar. At least, this is definitely how things work when you zoom in; If you click on the function corresponding to the taller bar it will put brackets underneath the small bars near it showing that the parent was responsible for all of it; and the parent is always shown as the taller bar.
-
yes :). Inclusive is time spent executing the function or any thing called by that function; Exclusive is ‘exclusive of called functions’, and is just the time spent in the function proper (or switching into/out of it).
-
Only for the toplevel, which I think you implied; and even then see @ron’s answer – this is cpu usage time, not wall clock time. AsyncTasks run in the main thread, and so will be included somewhere in the toplevel breakdown. Same for Handlers
-
answered by Eric
-
No, because of round up / round down (ie 1.87% would display as 1.9%); but the sum of the entries in “Exclusive” should add up to the total time shown in the upper right corner, which is the same as the number calculated for your question (3)
-
answered by Eric