Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Useful Sampling results with no Symbols?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Useful Sampling results with no Symbols?



On Mar 24, 2011, at 5:12 PM, Jeffrey Weston wrote:

> However, in a released product which has no symbols, our understanding is that when Sampler aggregates the stacks it compresses all the non-symbolized functions together.

Logically, what it's doing is symbolizing the stack traces first and then aggregating them.  For any given address, it searches for the nearest preceding symbol.  When symbols have been stripped, huge swaths of your code may not have any symbols and the search goes back and back (across functions, but the search algorithm can't know that) and eventually finds something.  So, all of those addresses get attributed to some unrelated symbol.

> Thus we loose valuable data about the path taken to a particular function.  In most cases, the samples we then get are not very useful.

Yeah, that's a nuisance.


> Is there anyway around this (either on developer side or on the user side)?
>
> Below is an example of what we see using an example App:
>
> Debug Build Sample (With Symbols):

> Release Build Sample (No Symbols):

Note that there's a middle ground between a debug build with full debugging symbols and a stripped release build: an unstripped release build.  That doesn't have debugging symbols, but does still have some symbols.

See the STRIP_INSTALLED_PRODUCT (Strip Linked Product) and STRIP_STYLE (Strip Style) build settings in Xcode.  For frameworks that get copied into your app, see COPY_PHASE_STRIP (Strip Debug Symbols During Copy).

Another possible approach requires the user to have the developer tools installed.  If they use either Shark or Instruments to collect a Time Profile, save that, and send it to you, I believe you can resymbolicate it.  Of course, most users won't have or want the developer tools to be installed, so that's a stretch.


You either need a tool which records all of the stack traces non-symbolically, or you need your app to have symbols.

It may be possible to build a tool to collect the non-symbolic traces using DTrace and its profile provider.  That's always installed, but would require the user to authenticate as an admin to run it.  You'd also have to deal with shared library relocation/sliding/whatever.  (I'm not thoroughly versed in that part.)  (Hmm.  Some experiments here with some well-documented DTrace one-liners yield no results.  DTrace only encounters errors walking the stack.  For reference, I was trying:

	sudo dtrace -n 'profile-50 /pid==$target/ {@[ustack()]=count()}' -p <pid>

and variants.)

Good luck,
Ken

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Useful Sampling results with no Symbols? (From: Jeffrey Weston <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.