Profiling system activity while measuring function runtimes

When you enable function instrumentation with system wide profiling, the IDE instruments your binary with code that measures function runtimes, then launches your application and starts a kernel event trace on the target. This way, the function entrance and exit events are included in the trace data, and you can see these events in the Timeline view in the System Profiler editor.

This workflow is handy when you suspect that other processes are impacting an application's performance at startup, because the kernel event trace tells you how much memory and CPU is used by all target processes. It's also useful for examining how a short-running program interacts with other processes. However, any trace should be limited to a few seconds because longer traces produce too much data to be useful.
To profile system activity while measuring function runtimes for an application:
  1. Create a launch configuration or modifying an existing one to define the same compile and link options as when profiling a single application, by following the first step in "Measuring function runtimes for a single application".
  2. In the launch configuration, select the Tools tab.
  3. Click Add/Delete Tool at the bottom.
  4. In the Tools selection dialog, check the Application Profiler and Kernel Logging boxes and click OK.
  5. On the Application Profiler tab that now appears in the launch configuration, select Functions Instrumentation as the profiling method.
  6. Under Profiling Scope, select System Wide.
    There are other profiling options that appear when you select this scope. For a summary of all options on the tab, see "Application Profiler tab".
  7. On the Kernel Logging tab, check the Launch with Kernel Log capturing box.
  8. Optional: If you want to delay the start of the kernel event trace, fill in the Wait interval (ms) field.
    This is handy for seeing how other processes affect your application at some point after its startup.
  9. In the System Profiler Kernel Log configuration dropdown, choose a kernel log configuration that defines the appropriate trace settings for your target. If necessary, click Edit and create a kernel event trace configuration using the Log Configurations window.
    For details on all UI fields you can fill in for a new configuration, see "Kernel event trace log configuration".
  10. If you want the IDE to display the QNX System Profiler perspective when you launch the application, check Switch to this tool's perspective on launch, below the Application Profiler tab.
  11. Click Apply to save the launch configuration settings.
  12. Click Run, Debug, or Profile to launch the application and start the kernel event trace.
The IDE launches your application, starts the kernel event trace on the same target, and switches to the QNX System Profiler perspective (if configured to do so). The Importing Session window appears, with a progress bar that reflects the IDE's importing of the trace data (which includes profiling results). When the trace finishes, the IDE asks you to open the kernel event log (.kev) file. If you select Yes, it then displays the trace data in the editor pane, which lets you interpret the data for analysis.