I am trying to understand how a traceview works. I have tried to analyze a method using the traceview but have a query about it.
I have attached the snapshot of the .trace. It indicates that the majority time is taken by (toplevel) marked in blue. however no further info is available on the same. (when this method is executed or what function it performs.)
Can anyone please explain to me why its consuming so much time?
Thanks in advance!
I ran into the same question today trying to find out where the code for "toplevel" was. I'm not an expert here, but here's what I think is happening:
http://www.androidcodesearch.com/acs/source/sdk/traceview/src/com/android/traceview/DmTraceReader.java suggests that "toplevel" is just a grab-bag dump for activity that has no known parent.
This is of course not very helpful for figuring out your problem, since a sizable portion of time seems to be being spent in "self." I would recommend acquiring the android source files for whichever android platform (froyo, ICS, etc.) you are working on and trying to poke around to see what might be taking so much time.
BTW - just to make sure you know, you may be entirely misled by this trace. Your trace is only for 7 milliseconds and is tied to some fancy class loading; I would not trust a traceview for such a limited time span on such matters, and even if accurate I can't possibly imagine why you're worried about taking 7 millis down to 5.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With