How to use ''Instruments'' on OS/X to profile: Difference between revisions
From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽
Line 6: | Line 6: | ||
== Running ''instruments'' == | == Running ''instruments'' == | ||
Once the ''<name>.dSYM'' directories are built, run the instruments GUI and: | Once the ''<name>.dSYM'' directories are built, run the instruments GUI and: | ||
# Click the menu to ''Choose Target...'' [[File:Choose Target.png| | # Click the menu to ''Choose Target...'' [[File:Choose Target.png|500px]] | ||
# Navigate to the program to run - yes, it's tedious. [[File:ChooseProgram.png]] | # Navigate to the program to run - yes, it's tedious. [[File:ChooseProgram.png|500px]] | ||
## Choose the program (note that the dSYM dir is there too) | ## Choose the program (note that the dSYM dir is there too) | ||
## provide the arguments to the program | ## provide the arguments to the program | ||
Line 13: | Line 13: | ||
=== The red dot === | === The red dot === | ||
Now click the 'Run' button (the red dot) [[File:TheRedDot.png]] | Now click the 'Run' button (the red dot) [[File:TheRedDot.png|500px]] | ||
Here's the result [[File:ItRuns.png]] | Here's the result [[File:ItRuns.png|500px]] | ||
Click to expand (and click the arrow in the circle to examine a sub-hierarchy of calls) [[File:ExpandCalls.png]] | Click to expand (and click the arrow in the circle to examine a sub-hierarchy of calls) [[File:ExpandCalls.png|500px]] |
Latest revision as of 20:06, 17 August 2018
The instruments profiles can be run from the command line, but it doesn't seem to pick up the symbols for the executables when run that way with Xcode 9. Here's how to fix that.
Building symbols
Even though executables are built using -g3 -O0, OS/X clang/gcc dies not include those symbols in binary images built by the linker. To make that info available to instruments, use the program dsymutil on the executable, .dylib and/or .so. This may be an iterative process; see the next section.
Running instruments
Once the <name>.dSYM directories are built, run the instruments GUI and:
- Click the menu to Choose Target...
- Navigate to the program to run - yes, it's tedious.
- Choose the program (note that the dSYM dir is there too)
- provide the arguments to the program
- and, below that, the full path to the working directory.
The red dot
Now click the 'Run' button (the red dot)
Click to expand (and click the arrow in the circle to examine a sub-hierarchy of calls)