Absent Method Calls in Instruments Stack Trace

I'm trying to profile my app for memory allocations on a device using Instruments. The problem is that the profiler shows only native method calls in the stack trace, my own methods don't show up... which makes the stack trace totally useless.



I'm using XCode 6.4 and the device is an iPhone 5c running iOS 8.4.


Any help would be appreciated.

Answered by alayouni in 24615022

The issue was due to a .dSYMM file generated by XCode as part of the build. The file is used in debug mode to symbolicate method calls. Instruments doesn't seem to be aware of its location. In order to fix that I had to do the following:

  • Before starting to record under Instruments, go to File->Symbols
  • Unfold your app item and select your app name
  • Click "Locate" in front of dSYM path
  • the dSYM file corresponding to the app should be under ~/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/[APP_NAME].app.dSYM.
  • A dialog should pop up asking you whether Instruments should always look for dSYM files under that location; that's what you want
  • Start recording; your method calls should now display properly
Accepted Answer

The issue was due to a .dSYMM file generated by XCode as part of the build. The file is used in debug mode to symbolicate method calls. Instruments doesn't seem to be aware of its location. In order to fix that I had to do the following:

  • Before starting to record under Instruments, go to File->Symbols
  • Unfold your app item and select your app name
  • Click "Locate" in front of dSYM path
  • the dSYM file corresponding to the app should be under ~/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/[APP_NAME].app.dSYM.
  • A dialog should pop up asking you whether Instruments should always look for dSYM files under that location; that's what you want
  • Start recording; your method calls should now display properly

In general this should not be necessary as Instruments uses Spotlight to locate your dSYMs. So as long as you don't build your projects into a location Spotlight cannot see, this should all just work automatically.


You can test this by profling your app from Xcode and taking a short recording. Then go to File->Symbols..., and look for your binary/library that is missing symbols. Copy it's UUID (it looks like XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX).

At a terminal run "mdfind XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" (with your UUID pasted there instead)

If Spotlight locates the dSYM in your build folder, then Instruments should be able to see it as well. If the file isn't listed, then Spotlight can't find the file. Either Spotlight isn't indexing that location, hasn't indexed it yet (maybe you just installed a large number of files), or perhaps you need to rebuild your Spotlight index ("sudo mdutil -E /").


If Spotlight locates your dsym but Instruments cannot, that is radar worthy.

Absent Method Calls in Instruments Stack Trace
 
 
Q