This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -120,6 +120,12 @@ Initial trace-status that is sent when an application registers. DLT_TRACE_STATU
Force log level and trace status of contexts to not exceed "ContextLogLevel" and "ContextTraceStatus". If set to 1 (ON) whenever a context registers or changes the log-level it has to be lower or equal to ContextLogLevel.
Default: 0
## InjectionMode
If set to 0, the injection mode (see [here](./dlt_for_developers.md#DLT-Injection-Messages)) is disabled.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -61,8 +61,8 @@ applications using the DLT user library.
The DLT daemon is a standalone application which is running as the center of
management and this is implemented as a single-thread process. The DLT daemon
communicates with the DLT clients over TCP/IP connections or over a serial line
with the applications using the DLT user library over named pipes (FIFOs) or
UNIX_SOCKET based on compile time configuration.
with the applications using the DLT user library over named pipes (FIFOs),
UNIX sockets or VSOCK sockets based on compile time configuration.
The message format is specified in the DLT AUTOSAR Standard. More details
concerning the exchanged user messages and their content can be found in
Expand DownExpand Up
@@ -94,6 +94,8 @@ mode, it uses the syslog daemon for log messages of the DLT daemon application.
- Open DLT output file, if specified
- After phase 1, the daemon initializes the connection handling:
- Delete, create and open its own named FIFO /tmp/dlt or UNIX_SOCKET
- If VSOCK support is enabled in the daemon, open, bind and listen to VSOCK
socket for incoming application connections.
- Open, bind and listen to TCP socket for incoming connections
- Setup and open serial device, if specified
- Then the daemon enters initialization phase 2:
Expand DownExpand Up
@@ -126,8 +128,8 @@ and possibly on the serial device, via poll() call.
- Create a new TCP connection
- If the newly created connection is the first TCP connection, send all log
messages already stored in ring buffer to DLT client.
- Event from incoming named pipe (FIFO) or Unix socket (from DLT user library
to DLT daemon):
- Event from incoming named pipe (FIFO) or UNIX socket and, if enabled, VSOCK
socket (from DLT user library to DLT daemon):
- Use dlt receiver to read data
- As long as there are DLT messages available in received data, the handle
user messages type can be found at src/shared/dlt_user_shared_cfg.h
Expand DownExpand Up
@@ -213,8 +215,8 @@ contains one entry for each context:
- Setup signal handler and atexit handler
- Ignore all pipe signals
- Create and open own named pipe (with the name /tmp/dlt<PID>, where <PID> is the
process id of the application using the DLT user library) or Unix socket IPC to
the DLT daemon
process id of the application using the DLT user library) or UNIX/VSOCK socket IPC
to the DLT daemon
- Open local file for storage, if specified
- Initialize receiver object
- Start housekeeper thread for receiving messages
Expand DownExpand Up
@@ -331,6 +333,12 @@ During sending of a network trace message, the following things occur:
During registration of a callback function for an injection message, then following
steps are executed:
- Check if the environment variable DLT\_DISABLE\_INJECTION\_MSG\_AT\_USER is set.
- If yes:
- libdlt will ignore all data/messages from dlt-daemon, including:
loglevel change, custom injection messages ...
- If no (default):
- libdlt will handle all data/messages from dlt-daemon as normal.
- For the specified context, check if service id is already in the table of the
registered callbacks (this table is dynamically growing in steps of one entry).
- If yes:
Expand All
@@ -342,10 +350,18 @@ steps are executed:
- Store service id in callback table
- Store function pointer in callback table
#### Android: Thread termination
On Android, `pthread_cancel` is not available in bionic. So current
implementation uses *SIGUSR1* and `pthread_kill` to terminate housekeeper
thread. Due to this, application which is linked to DLT library should not
define *SIGUSR1*.
### Communication between DLT daemon and DLT user library
The communication mechanism (IPC) used between DLT daemon and DLT user library
are named pipes (FIFOs or UNIX_SOCKETS, based on compile time configuration).
are named pipes (FIFOs), UNIX sockets or VSOCK sockets, based on compile time
configuration).
During the startup of the DLT daemon, the DLT daemon creates and opens the IPC
(FIFOs or UNIX_SOCKET) on the configured path called /tmp/dlt. If a DLT user
Expand DownExpand Up
@@ -379,6 +395,16 @@ itself with the same PID, which is impossible. To solve this problem, the
UNIX_SOCKETS based communication is used. The UNIX_SOCKETS IPC is also supported
in the Non-linux platforms (eg: QNX).
If the daemon is built with VSOCK socket support, it can also receive log
messages from processes running in virtual machines. The communication mechanism
between the daemon and the DLT user library on the host is still FIFOs or UNIX
sockets. But the DLT user library for the system running in the virtual machine
can be built to use VSOCK sockets for sending log messages to the daemon. See
"man vsock" for more information about VSOCK sockets. This is an alternative to
using a [multinode](dlt_multinode.md) setup for receiving DLT log messages from
processes in a virtualized environment. No passive daemon(s) are required and it
works without having a network configured between the guest and the host.
### Place of message creation
The following table shows, where the certain types of DLT messages are created.
Expand DownExpand Up
@@ -746,7 +772,7 @@ The shared directory contains the following files:
| --------- | ----------- |
| dlt_common.c | Common helper functions, such as: Print functions for DLT messages, Functions for handling DLT Ids, Filter functions, DLT message handling functions, Functions for handling DLT files, DLT receiver functions, Log handling, Ringbuffer functions, Setting and checking of storage header |
| dlt_common_cfg.h | Compile time configuration for dlt_common.c |
| dlt_user_shared.c | Shared functions, required by the DLT daemon and the DLT user library, such as: Setting and checking the user header, Sending DLT messages over named pipes (FIFOs) or UNIX_SOCKET|
| dlt_user_shared.c | Shared functions, required by the DLT daemon and the DLT user library, such as: Setting and checking the user header, Sending DLT messages over named pipes (FIFOs) or UNIX/VSOCK sockets|
| dlt_user_shared.h | Header file for dlt_user_shared.c |
| dlt_user_shared_cfg.h | Compile time configuration for dlt_user_shared.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sends the given message as DLT messages to DLT daemon or prints the raw DLT messages into a local file.
## OPTIONS
-h
: Display a short help text.
-g
: Switch to non-verbose mode (Default: verbose mode).
-a
: Enable local printing of DLT messages (Default: disabled).
-k
: Send marker message.
-d
: Milliseconds to wait between sending messages (Default: 500).
-f
: Use local log file instead of sending to daemon.
-n
: Number of messages to be generated (Default: 10).
-m
: Set log mode 0=off, 1=external, 2=internal, 3=both.
-l
: Set log level, level=-1..6 (Default: 3).
-A
: Set app ID for send message (Default: LOG).
-C
: Set context ID for send message (Default: TEST).
-t
: Set timeout when sending messages at exit, in ms (Default: 10000 = 10sec).
-r
: Send raw data with specified size instead of string.
# EXAMPLES
Send "HelloWorld" with default settings (10 times, every 0.5 seconds) as DLT message to dlt-daemon::
dlt-example-user HelloWorld
Set app ID to `APP1`, context Id to `TEST` and log level to `error` for send message::
dlt-example-user -l 2 -A APP1 -C TEST HelloWorld
Send 100 DLT messages every second::
dlt-example-user -n 100 -d 1000 HelloWorld
# EXIT STATUS
Non zero is returned in case of failure.
# Notes
The default descriptions for application and context registration are used irrespective of the IDs that could be set. App will always register with "Test Application for Logging" and context with "Test Context for Logging".
# AUTHOR
Darian Biastoch (dbiastoch@de.adit-jv.com)
# COPYRIGHT
Copyright (C) 2020 ADIT GmbH. License MPL-2.0: Mozilla Public License version 2.0 <http://mozilla.org/MPL/2.0/>.
# BUGS
See Github issue: <https://github.com/GENIVI/dlt-daemon/issues>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -10,6 +10,8 @@ Application ID | Application Identifier is a unique identifier for an applicatio
Context ID | This is a user defined ID to group log and trace messages produced by an application. Each Application ID can own several Context IDs and the Context IDs shall be unique within an Application ID. The identification of the source of a log and trace message is done with a pair of Application ID and Context ID. It is composed by four 8 bit ASCII characters.
Control Message | A control message is send by a connected client application (e.g. Log Viewer) to the DLT Daemon that includes an action request. E.g. change the Log level of a certain application).
DLT Daemon | The DLT Daemon is the central component which receives all logs and traces from the DLT user applications. The DLT Daemon forwards all logs and traces to a connected DLT client (e.g. Log Viewer) or stores them optionally in a file on the target.
DLT Library | Provides applications (esp. DLT users) with an API to produce DLT messages and to handle DLT Control Messages accordingly.
DLT User | A DLT User is a type of application that produces log messages. It typically uses the DLT library to produce the messages and resembles an ECU.
DLT Viewer | The DLT Viewer is the GENIVI Log Viewer implementation. It is a Qt-based desktop application able to run on Windows and Linux operating systems. Further information and source code can be found here: https://github.com/GENIVI/dlt-viewer
Gateway DLT Daemon | In a Multi-Node system, the DLT Daemon running on the Node directly connected to a Log Viewer is called Gateway DLT Daemon (if configured as Gateway). It forwards log messages from Passive DLT Daemons to Log Viewers and command/control messages from Log Viewer(s) to Passive DLT Daemon(s).
Injection Message | An injection message is a control message for a specific DLT application.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -270,4 +270,27 @@ The following strategies are implemented:
Note :
1. Combinations (not allowed: combinations with ON_MSG,combination of ON\_FILE\_SIZE with ON\_SPECIFIC\_SIZE)
2. If on\_demand sync strategy alone is specified, it is advised to concatenate the log files in sequential order before viewing it on viewer.
3. In case multiple FILTERs use the same `File` value, it is recommened that the following settings must also have same values: `NOFiles`, `FileSize` and `SpecificSize`
3. In case multiple FILTERs use the same `File` value, it is recommened that the following settings must also have same values: `NOFiles`, `FileSize` and `SpecificSize`
## Maintain Logstorage Log Level Implementation
The log level setting of each user context in the logstorage FILTER will be
treated as the highest priority. Other clients (e.g: dlt-control, dlt-viewer)
can update the user context's log level to a lower level but can not update
to a higher level. In case the clients need to update the user context's log
level to a higher level, the new macro ```MaintainLogstorageLogLevel``` is
implemented in the ```[General]``` session to allow changing user context's
log level to any level or maintain the log level of logstorage configuration.
A typical configuration file may look like:
```
[General]
MaintainLogstorageLogLevel=OFF
```
By setting ```MaintainLogstorageLogLevel=OFF``` or ```MaintainLogstorageLogLevel=0```,
the clients are able to update any log level to user contexts.
By setting ```MaintainLogstorageLogLevel=ON``` or ```MaintainLogstorageLogLevel=1```
or not set, the logstorage will maintain its log level as the highest priority.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters