Use Function Instrumentation in the System Profiler

By using the data from the Function Instrumentation mode in System Profiler, you can:

Figure 1. Application Profiler data in the System Profiler timeline.
Note: If you're missing function names in the System Profiler Timeline view, you may want to consider adding this information by instrumenting your binaries with the Function Instrumentation library, and running in Kernel Events mode. For additional information, see Use Function Instrumentation mode for a single application.

Launching from the command line on the target machine

To launch from the command line:

  1. Set the environment variable to the following:
    QPROF_KERNEL_TRACE=1 

    Set this environment variable for each process, or export it for all processes; it won't affect uninstrumented binaries.

  2. Launch one or more processes on the target.
  3. In the IDE, open the System Profiler perspective and run Kernel Logging for several seconds.
    Note: You can use tracelogger to capture events generated by programs compiled with Function Instrumentation.
  4. Open the resulting .kev file in System Profiler editor.
  5. Optional: You can import the .kev file into the Application Profiler perspective from the Profiler Sessions view (Import Application Profiler Session icon), or by using File > Import to open the Import wizard.

Launching from the IDE

To profile a process:

  1. Create a launch configuration for the binary.
  2. On Tools tab, select Add/Delete Tools, then select Application Profiler.
  3. Select Kernel Logging.
  4. Click OK
  5. On the Application Profiler tab, select Functions Instrumentation.
  6. For the Project Scope, select System Wide.
  7. Disable the option Switch to this tool's perspective on launch if it's currently selected.
  8. Click Apply.
  9. Switch to Kernel Logging tab.
  10. Select Launch with Kernel Log capturing.
  11. Select one of existing System Profiler Kernel Log configurations. If you don't have any, click Edit and create one.
  12. Select the option Switch to this tool's perspective on launch.
  13. Click Apply.
  14. Click the Upload tab.
  15. Deselect Use unique name for the uploaded binary.
  16. Click Apply.
  17. Click Run.