Changes between Version 2 and Version 3 of instruments


Ignore:
Timestamp:
07/01/16 02:05:10 (9 years ago)
Author:
agscott1
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • instruments

    v2 v3  
    1 == What is Apple Instruments? ==
     1= What is Apple Instruments? =
    22
    33Apple Instruments is an application profiler that can be used to find performance issues by using a multitude of separate "instruments." These instruments collect and display relevant data such as: time, i/o use, network use, memory allocations and leaks, and much more. For simplicity, we will only be using the time instrument to profile ISSM. In this case, the time instrument measures how long it takes to run a certain test in ISSM. It will  also generate a list of all functions used during the program's execution, as well as individual times for those functions.
    44
    5 == Installing Instruments ==
     5= Installing Instruments =
    66First, you must be running Mac OSX in order to access and run Instruments.
    77
     
    2020Instruments will then be located in the directory above.
    2121
    22 == Setting up a profiler test ==
     22= Setting up a profiler test =
    2323Before using Instruments, we need to execute a test from MATLAB. Under `$ISSM_DIR/test/NightlyRun/` create a `profile_test.m` file and paste the following code inside the newly created file.
    2424{{{
     
    5656}}}
    5757
    58 == Running Instruments ==
     58= Setting up Instruments =
    5959
    6060In order to run Instruments on the test above, we need to open Instruments and select the Time Profiler.
     
    6969
    7070[[Image(http://i.imgur.com/VWgJEpv.jpg)]]
     71
     72= Profiling your ISSM test =
     73
     74After setting up the target, we can finally start to profile ISSM. To do this, just hit the record button and let Instruments run. The record button is just a red circle at the top by the pause button. In order to get a better idea of how ISSM is performing, it might be necessary to do a few "runs." This just means recording a new run once the previous run has finished. Recording multiple runs allows Instruments and ISSM to overcome any initial setup operations that might falsely inflate the time, compared to a normal scenario. Below is an image showing what happens when we create multiple runs.
     75
     76We can also view each run by selecting the drop down arrow on the left of the "CPU Usage" label. If a run is unsuccessful or was accidentally paused before completion, we can delete that specific run by selecting it and going to `Instrument -> Delete Run #` from the main menu.
     77
     78[[Image(http://i.imgur.com/K0p992f.jpg)]]
     79
     80== Obtaining Useful Information from a Run ==
     81
     82As you might have noticed, there is nothing useful from the default view. In order to see what is happening, we need to change a few settings. To start, we click the gear icon located in the middle right hand side of the screen (next to an icon that looks like an 'E'). This shows us the display settings. Under the "Call Tree" options, we '''select''': `Separate by Thread`, `Invert Call Tree`, `Hide System Libraries`, and `Flatten Recursion`. Make sure that these are the '''only''' selected options.
     83
     84This will clean up our view of the call tree and will only show relevant functions ordered by time (from highest to lowest). The image below shows all of the settings needed to obtain accurate information about what functions within ISSM take the most time. The first red rectangle highlights where the display settings icon is while the second red rectangle shows where the "Call Tree" options that need to be changed are.
     85
     86[[Image(http://i.imgur.com/j8kCtok.jpg)]]
     87