Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode's Profiler does not show Symbol names

Tags:

xcode

ios

profile

Updated to xCode 4.5 and when time profiling my app Symbol Name doesn't show classes or objects anymore, but shows memory addresses see below.

0x2fd42e13
0x38014448

I used to see the following

main
NSManagedObjectContext

When I could see the class names then I can track down the issues in the extended detail. Now the extended detail shows the same thing as the 0x2fd42e13.

like image 239
jdog Avatar asked Sep 26 '12 21:09

jdog


3 Answers

To resolve my issue I had to tell Instruments where my binary was as it had lost track of it for some reason.

1. Run Instruments as you normally would to get the masked data.

enter image description here

2. In the Project Navigator, expand the Products folder and click your application (either provider (.appex) or application (.app). If your File Inspector is not visible, right click the application and click "Show File Inspector"

enter image description here

3. On the right side of your screen you should now see the file inspector for your binary. Opposite click on the "Full Path" property and click "Copy".

enter image description here

4. Go back into Instruments and go to File->Symbols

enter image description here

5. Drop down your application or provider on the left and click on the item with the dot next to it (it should have the same name as your application)

enter image description here

6. You'll notice that the Binary Path is red. This means that Instruments has lost track of your binary file. Click the small folder icon on the bottom right to bring up a Select File dialog. Press Command+Shift+G to enter a directory path, and paste the path that we copied from xcode earlier.

enter image description here

7. You should now have the binary selected, click Open to open it. Click done on the Dialog to close the windows. Instruments should now show the proper details and symbol names while profiling your code.

enter image description here

  1. If this reoccurs, and your binary is located at a path like /Users/<User>/Library/Developer/Xcode/DerivedData/..., you will need to add this to your default search path in Instruments. /Library is not indexed by Spotlight, so is not searched for by Instruments. Go to Instruments > Preferences > Symbols, and add /Users/<User>/Library/Developer/Xcode/DerivedData/.
like image 126
Nathan F. Avatar answered Nov 14 '22 13:11

Nathan F.


Solved it myself:

Edit your scheme where it says "WhateverProjectNameIs>iPad 6.0 simulator"

Then click on "Profile" on the left On the Info tab, change Build Configuration to Debug (probably set to Release) That should do it. Note that for whatever reason, the build target is not set to the same build configuration as the profile target and this has tripped me up more than a time or two.

like image 14
jdog Avatar answered Nov 14 '22 12:11

jdog


Profiling the debug configuration will not give you correct profile values. The debug configuration is not compiled for speed, and all your NSLog statements are still in.

I created a "Profile" build configuration to deal with this issue. See my answer to a similar Stackoverflow question.

like image 2
fishinear Avatar answered Nov 14 '22 11:11

fishinear