OpenGL Driver Instrument

December 12th, 2011

Filed under: Instruments, OpenGL | Be the first to comment!

Researching Instruments for Xcode Tools Sensei allowed me to become familiar with most of the built-in instruments. Due to the high number of instruments, there was no way for me to cover them all in the book. I focused on the most commonly used instruments in the book. I can use this blog to explain some of the other instruments. I start with the OpenGL Driver instrument.

What the OpenGL Driver Instrument Does

The OpenGL Driver instrument records OpenGL statistics. Some statistics this instrument records include the following:

  • The amount of free video memory.
  • The number of textures used.
  • The number of buffer swaps.
  • The amount of time the CPU waited for the GPU.
  • The number of surfaces the GPU allocated.

Obviously OpenGL applications are the ones to benefit from the OpenGL Driver instrument. The OpenGL ES Driver instrument records similar information for iOS applications. The OpenGL ES Driver instrument is available in both the OpenGL ES Driver and OpenGL ES Analysis templates. In most cases you should use the OpenGL ES Analysis template for OpenGL ES profiling.

One thing you’ll notice when you create a new trace document is there is no template for the OpenGL Driver instrument. Pick one of the other templates (Time Profiler and Empty would be good choices for profiling purposes) and add the OpenGL Driver instrument to the trace document by dragging the instrument from the Library to the instrument list. Click the Library button in the trace document window toolbar to open the Library.

Before You Trace

Before you start tracing you must tell Instruments the statistics to show in the track pane and detail view. Click the Info button next to the OpenGL Driver instrument to open a pop-up editor. Click the Configure button to see all the available statistics. Select the checkbox next to a statistic to tell Instruments to show it in the track pane and detail view. The extended detail view shows all the statistics so you should show only the most important statistics in the track pane and detail view.

OpenGL Driver Configuration

The screenshot also shows where you set the sampling rate.

Trace Results

Use the Target menu in the trace document window toolbar to pick an application to profile. Click the Record button to start profiling. Click the Pause button to pause recording and see the statistics. The track pane graphs each statistic you told the OpenGL Driver instrument to observe.

The detail view at the bottom of the trace document window has one column for each statistic you told Instruments to show. There is one row in the detail view for each sample the OpenGL Driver instrument recorded. Selecting a sample from the list shows all the OpenGL statistics for that sample in the extended detail view. The extended detail view is on the right side of the trace document window. If you don’t see it, choose View > Extended Detail or click the right button in the View group in the toolbar.

Facebooktwittergoogle_plusredditmail

Tags:


Leave a Reply

Your email address will not be published. Required fields are marked *