O'Reilly logo

Beginning Mac OS® X Programming by Drew McCormack, Michael Trent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A.2. Chapter 2

A.2.1. Exercise 1 solution

Use the following steps to collect the sample:

  1. Launch /Developer/Applications/Performance Tools/Sampler. The program starts but no windows appear on-screen yet.

  2. Choose FileNew. A dialog appears allowing you to specify the program you want to sample.

  3. Click the Set button next to the Executable text field. This brings up a standard open panel.

  4. Select /Applications/Stickies in the Open panel and click the Open button. The Executable text field will be filled with the application's path.

  5. Click OK to dismiss the dialog. A Sampler window like the one shown in Figure A-1 appears. Notice the three tabs: Browser, Outline, and Trace. The Browser tab, containing empty Browser and Call Stack views, is selected.

    Figure A.1. Figure A-1
  6. Click the Launch & Record button in the Sampler window's upper-right corner. The Stickies application appears in the Dock, and its windows appear behind the Sampler application.

  7. Let Stickies run for a few seconds and click the Stop Recording button. Sampler's Browser and Call Stack views change to display Stickies' call stack information.

The browser area shows a tree containing all the frames recorded by Sampler. The Call Stack table displays the most commonly occurring backtrace that includes the frame selected in the browser. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required