Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FSDirectorySize code finished




How did you get Shark to tell you this? I have very little experience with Shark, and when I ran it it said that about 40% of the time was spent in dyld_something_or_other. How do you get it to show you the useful information you got?


It's hard to explain how to use it exactly. It's kind of like
explaining how to walk on two feet without falling over. You fail a
lot and then finally you just figure out how to do it. I'm by no
means an expert but I've gotten better at "getting to the information."


In particular your "dyld something or other" might look more
interesting to you if you check the "Charge System Libraries to
Callers" box in the Callstack Data Mining section of the side-
drawer.  If you check this and then switch to "Heavy" view, you'll
see the function from you app that was heaviest in the sample tree.


In my experience "dyld something or other" only appears on debug builds (I have always assumed it is associated with zerolink, but I may be wrong). You do of course want to Shark your release build if you want to get any useful information out of it. Apologies if I'm stating the obvious here!


Remember to enable debug symbols for your release build. This is turned off by default I think. If you are evaluating a standalone piece of code (say summing up a large array), make sure the code REALLY does something, so gcc doesn't optimize it out (probably not a problem if you are making system calls).

In my experience shark does a good job once you've got the hang of it, although I have noticed a few things it's worth being aware of -
1. The static analysis sometimes gets the loops mixed up if all optimizations were turned on, resulting in it making false claims of things like loop invariants
2. The sampling accasionally has to be taken with a pinch of salt if you're looking at it on a per-source-line basis: simg5 sometimes makes a different (and on the surface more convincing) analysis of exactly what's actually _causing_ the bottleneck that occurs _close_to_ the line that's getting all the samples. I presume this is due to pipelining
3. I haven't managed to get Shark to display source code for templated functions (which may be relevant in your case).


And yes, I am going to raise bugs against 1 and 3.

Hope this helps
Jonny
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.