dlt-daemon

dlt-qnx-system

QNX specific logging features of dlt are managed by the dlt-qnx-system process. It currently contains the message forwarder from slogger2 to DLT.

The application listens to the system logs on QNX (slogger2) and sends them to DLT. The prerequisite is that dlt-daemon is already started and running. dlt-qnx-system loads by default the configuration file /etc/dlt-qnx-system.conf.

In order to catch all logs via slog2, the syslog needs to forward to slogger2 in syslog.conf.

To change the log level, use application ID and context ID set in configuration file. DLT_INITIAL_LOG_LEVEL can be set on startup phase, or control message can be sent from DLT client (e.g. dlt-control, DLT Viewer) at runtime. Refer to dlt_for_developers.md for more detail.

Usage

dlt-qnx-system [-h] [-d] [-c FILENAME]
-h

Display a short help text.

-d

Daemonize. Detach from Terminal and run in background.

-c

Load an alternative configuration file. By default the configuration file /etc/dlt-qnx-system.conf is loaded.

Non zero is returned in case of failure.

Configuration

By default, the configuration is loaded from /etc/dlt-qnx-system.conf. It contains a few basic options:

Slogger2 adapter

The slogger2 adapter that can be enabled in dlt-qnx-system attaches to slogger2 and converts the messages to dlt messages.

Log level mapping

As the severity levels on QNX system log are different from DLT Log Level, the below table shows how they’re converted from the former to the latter.

QNX System Log Level DLT Log Level
SLOG2_SHUTDOWN DLT_LOG_FATAL
SLOG2_CRITICAL DLT_LOG_FATAL
SLOG2_ERROR DLT_LOG_ERROR
SLOG2_WARNING DLT_LOG_WARN
SLOG2_NOTICE DLT_LOG_INFO
SLOG2_INFO DLT_LOG_INFO
SLOG2_DEBUG1 DLT_LOG_DEBUG
SLOG2_DEBUG2 DLT_LOG_VERBOSE

Context Mapping

The json file dlt-slog2ctxt.json can be used to map slogger names to dlt-contexts.

Example

Here is an example that sets a mapping from the “dumper” process to the DLT Context “DUMP”, and the QNX Hypervisor to “QVM”. The description field is in the registration with libdlt.

{
  "DUMP": {
    "name": "dumper",
    "description": "Writes core dump files to disk"
  },
  "SYSL": {
    "name": "syslogd",
    "description": ""
  }
}

Runtime enable/disable slog2 adapter

The slog2 parser callback can be disabled and reenabled at runtime by using an injection.

App ID Context ID Service ID Data Description
QSYM QSYC 0x1000 00 Disable slog2 adapter
QSYM QSYC 0x1000 01 Reenable slog2 adapter

Example:

dlt-control -e QNX -a QSYM -c QSYC -s 4096 -m "00" -u
dlt-control -e QNX -a QSYM -c QSYC -s 4096 -m "01" -u