Skip to content

Latest commit

 

History

History
119 lines (79 loc) · 3.77 KB

dlt-qnx-system.md

File metadata and controls

119 lines (79 loc) · 3.77 KB

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:

  • ApplicationId: this QNX system log forwarder will have this application ID and appear on DLT client. Default value is QSYM.
  • ApplicationContextID: the context ID of the above application to appear on DLT client. Default value is QSYC.
  • QnxSlogger2Enable: when the value is 1 (by default), the QNX slogger2 adapter which sends slogger2 to DLT will be started. Otherwise if the value if 0, it won't be started.
  • QnxSlogger2ContextId: this will set the context ID of the QNX slogger2 adapter. Default value is QSLA.
  • QnxSlogger2UseOriginalTimestamp: when the value is 1 (by default), slogger2 event timestamps will be used as DLT timestamps.

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