Using Function Instrumentation in the System Profiler

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

System Profiler: Application Profiler data

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 Using 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:

    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.
Related concepts
Using Function Instrumentation with the Application Profiler
Using Sampling and Call Count instrumentation mode
Using Function Instrumentation mode for a single application
Comparing profiles
Related tasks
Creating an Application Profiler session
Creating a profiler session by importing profiler data
Profiling a single-threaded application
Profiling a running process for an existing project
Using postmortem profiling for Call Count and Sampling
Postmortem profiling
Running an instrumented binary with profiling from a command prompt (Function Instrumentation mode)
Taking a snapshot of a profiling session