Skip to content

Commit

Permalink
Fix iOS profiling symbols (#2085)
Browse files Browse the repository at this point in the history
* Always generate dsym for iOS builds

Fixes issue where Instruments fails to find symbols for profiler

* Remove docs for fixing missing symbols in Instruments
  • Loading branch information
matteblair authored Sep 8, 2019
1 parent d2af9a0 commit 1284760
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
Binary file removed images/instruments-locate-binary.png
Binary file not shown.
Binary file removed images/instruments-missing-symbols.png
Binary file not shown.
16 changes: 0 additions & 16 deletions platforms/ios/DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,3 @@ set_target_properties(myIosTarget PROPERTIES XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT
```

Some build configurations are more easily applied through Xcode settings, and some are only relevant when Xcode is the target IDE.

## Fix missing symbols when profiling in Instruments ##

After running the Time Profiler in Xcode's Instruments you might see traces with memory addresses instead of function names, like in the image below:

![Instruments trace with missing symbols](/images/instruments-missing-symbols.png)

For each Instruments run where function names are missing use the following steps to locate the symbols that Instruments needs to show the names correctly.

After collecting data from a run and stopping the Time Profiler, go to `File` > `Symbols...`

In the symbols pane that appears, select `TangramMap` in the menu on the left and then press the folder icon next to the binary path to choose the correct binary file.

![Instruments symbols pane](/images/instruments-locate-binary.png)

The correct binary file is the file named `TangramMap` in the directory shown in the file chooser that appears (located within the tangram-es repository at `build/ios/Release-iphoneos/TangramMap.framework/TangramMap`). After choosing the binary file, press `Done` to close the symbols pane and the function names will appear correctly in your Time Profiler trace.
4 changes: 4 additions & 0 deletions platforms/ios/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ set_target_properties(TangramMap PROPERTIES
XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14"
XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++"
XCODE_ATTRIBUTE_GCC_TREAT_WARNINGS_AS_ERRORS "YES"
# Generate dsym for all build types to ensure symbols are available in profiling.
XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS "YES"
)

### Configure static library build target.
Expand Down Expand Up @@ -169,6 +171,8 @@ set_target_properties(tangram-static PROPERTIES
XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14"
XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++"
XCODE_ATTRIBUTE_GCC_TREAT_WARNINGS_AS_ERRORS "YES"
# Generate dsym for all build types to ensure symbols are available in profiling.
XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS "YES"
# The Xcode settings below are to pre-link our static libraries into a single
# archive. Xcode will take the objects from this target and from all of the
# pre-link libraries, combine them, and resolve the symbols into one "master"
Expand Down

0 comments on commit 1284760

Please sign in to comment.