Running a kernel event trace

You can create log configurations to define kernel event trace parameters, then run one of these configurations to perform a trace. The generated log file contains data gathered from a target machine, including kernel events, CPU activity, and process and thread activity.

Before you can gather data from a QNX target, you must create a connection to it.
Note: In this SDP release, the instrumented version of the kernel (procnto*-instr) is the only version that we ship. This component includes a small, efficient module that generates events based on process and thread activity such as kernel calls and context switches. So, you don't need to confirm that this process is running on the target, unlike in previous releases.
To run a kernel event trace from the launch bar:
  1. In the Launch Configuration dropdown, select a log configuration.
    Log configurations for kernel event traces are indicated by the System Profiler icon (). You can create a log configuration by selecting New Launch Configuration, which opens a wizard that guides you through this task. If you have an existing configuration, skip to Step 3.
  2. Follow the steps in the New Launch Configuration wizard:
    1. Select an initial launch mode of Log.
    2. Select a launch configuration type of Neutrino Kernel Event Trace.
    3. Set the log configuration properties as needed.
    4. When you're finished setting the properties, click Finish to exit the wizard.
    You can then select the new Launch Configuration entry for this new log configuration to continue.
  3. In the Launch Target dropdown, select the target that you want to trace.
  4. Click the Log button (Icon: Log button) on the left of the launch bar.
    The kernel on the target begins logging event data to the output named in the log configuration. The procedure is explained in How kernel event tracing works. In the Kernel trace window, you can see the progress of the trace and choose to run it in the background.

When the trace finishes, the IDE asks you to open the kernel event log (.kev) file. If you select Yes, it then displays the file's data in the editor pane and switches to the QNX System Profiler perspective, which contains many views that let you interpret the trace data for analysis.

Note: You can also use the logging button (Icon: Start QNX logging) in the toolbar (in the upper right area of the IDE) to start a new trace based on the selected log configuration. The dropdown button (Icon: Start QNX logging) next to this icon opens a menu that lists the recently used log configurations, the Log With... submenu (which is explained in the next subsection), the Log Configurations option (which opens a window listing all log configurations), and an option for defining favorite configurations.

Starting a kernel event trace from the Target Navigator

You can also manage log configurations and start kernel event traces from the Target Navigator view.

The prerequisite of having an active target connection also applies for this usage scenario.
To run a kernel event trace from the Target Navigator:
  1. In the Target Navigator view, select the target (or any process listed under it) that you want to trace, then right-click to display the context menu.
  2. Point to Log With... to display the log configurations submenu.

    This submenu lists the supported log types. You can click the 1 Kernel Event Trace entry to bring up the Kernel Event Trace window, which lists the available log configurations for running kernel event traces. If you have an existing configuration that you want to use, skip to StepĀ 3.

    If you haven't created a kernel event trace configuration, the IDE opens the Log Configurations window and defines a default configuration with a name like Kernel Log of target.

    Note: Even if you click Close without changing any settings or clicking Log to run a trace, the IDE still saves this configuration and you will see it listed in the Kernel Event Trace window.

    The Log With... submenu also contains the Log Configurations... option, which opens the window for managing log configurations. Here, the toolbar in the upper left corner lets you create, duplicate, and delete log configurations, as well as edit their property settings.

  3. Start the kernel event trace.
    • If you're in the Kernel Event Trace window, select the configuration to use, then click OK.
    • If you're in the Log Configurations window, click Log.
    The kernel on the target begins logging event data to the output named in the configuration. The Kernel trace window shows the progress of the trace and allows you to run it in the background.

When the trace finishes, the IDE asks you to open the kernel event log (.kev) file. If you select Yes, it then displays the file's data in the editor pane and switches to the QNX System Profiler perspective, which contains many views that let you interpret the trace data for analysis.

The Target Navigator view also provides a logging button in the title bar (Icon: Start QNX logging), which starts a new trace based on the selected log configuration. The dropdown button (Icon: Start QNX logging) next to this icon lists the recently used configurations, the Log With... submenu, and an option for defining favorites.