Initiating kernel logging
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.
Modifying the kernel logging launch configuration
To modify the kernel logging:
- From QNX TARGETS, right-click the target.
- Click Capture QNX Kernel Event Trace (with tracelogger).
Tracelogger is launched and a trace.kev file is saved in
the project. You can customize this command using launch configuration for
tracing, as described in the section that follows.
Starting kernel logging by creating a kernel launch configuration
You can add a launch configuration that starts kernel logging.
To add the configuration:
- From a mounted workspace, expand the project folder and click launch.json.
- Click the blue Add Configuration... button.
- From the drop-down menu, select Run Tracelogger. The
configuration to run trace logging from launch.json is
added to the file:
{ "type": "qnx-gdb", "request": "launch", "name": "tracelogger", "gdb": "none", "program": "tracelogger", "args": [ "-s10", "-f/dev/shmem/trace.kev" ], "qnxtarget": "default", "upload": false, "files": [ { "operation": "download", "remotePath": "/dev/shmem/trace.kev" } ] }
- Modify the options as needed, but don't change the task's label. For a list of tracelogger options, go to tracelogger in the Utilities Reference.
- Don't edit the name option if you want to run the default Capture QNX Kernel Event Trace (with tracelogger) command.
- Launch the configuration as described in the previous section or use the Capture QNX Kernel Event Trace (with tracelogger) command.
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",
],
}
]
}
Page updated: