Initiating kernel logging

Updated:

You can use kernel logging on a selected target. When you run the logging command, QNX Toolkit attempts to find a launch configuration for the selected target in the currently active Workspace. If none is found, then it creates the default launch configuration and runs it.

Starting kernel logging on a selected target

To start kernel logging:

  1. From QNX TARGETS, right-click the target.
  2. Click Capture QNX Kernel Event Trace (with tracelogger). Tracelogger is launched and a trace.kev file is saved in the project.

Starting kernel logging by running a kernel launch configuration

You can add a launch configuration that starts kernel logging.

To add the configuration:

  1. From a mounted workspace, expand the project folder and click launch.json.
  2. Click the blue Add Configuration... button.
  3. From the drop-down menu, select Run Tracelogger. The configuration to run trace logging from launch.json is added to the file.

Starting kernel logging with the remote shell command

You can use a task configuration to setup kernel logging using a remote shell command. This allows you to initiate kernel logging from the terminal or assign a shortcut.

To configure the remote shell command:

  • In the Workspace, click tasks.json
  • Configure a task of type qnx-shell.

Example:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Download trace",
      "type": "qnx-shell",
      "command": "download",
      "args": [
        "/tmp/sample-trace.kev",
        "${workspaceFolder}/task-trace.kev"
      ],
      "dependsOn": [
        "Run Tracelogger"
      ]
    },
    {
      "label": "Run Tracelogger",
      "type": "qnx-shell",
      "command": "exec",
      "args": [
        "tracelogger",
        "-s3",
        "-f/tmp/sample-trace.kev",
      ],
    }
  ]
}