diff options
author | Sebastian Unger <sunger@de.adit-jv.com> | 2020-04-29 15:50:28 +0200 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2021-01-06 09:27:28 +0900 |
commit | 88fe2fda4aadde540f860ef1255781eb3674454e (patch) | |
tree | 26602432da9483816ee58f0ada522f39c117b85e /doc | |
parent | 3e4b840acca69a17cb13c2752d076a6f61175885 (diff) | |
download | DLT-daemon-88fe2fda4aadde540f860ef1255781eb3674454e.tar.gz |
doc: Rewrote the DLT user documentation.
- Write introduction and prepare new TOC
- Intro to Get Started, instructions on how to download and detailed TOC further
- Started Run DLT Demo section
Signed-off-by: Sebastian Unger <sunger@de.adit-jv.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/dlt_build_options.md | 81 | ||||
-rw-r--r-- | doc/dlt_demo_setup.md | 88 | ||||
-rw-r--r-- | doc/dlt_glossary.md | 2 |
3 files changed, 171 insertions, 0 deletions
diff --git a/doc/dlt_build_options.md b/doc/dlt_build_options.md new file mode 100644 index 0000000..9a91193 --- /dev/null +++ b/doc/dlt_build_options.md @@ -0,0 +1,81 @@ +# DLT Build Options + +DLT is highly configurable. It allows you to choose between certain technologies +or implementations and to turn on or off certain features. This way, you can +adjust it to your needs and keep the build process as simple as possible. + +In order to change these options, you can modify these values with cmake, do the +appropriate changes in CmakeList.txt or via the commandline for cmake + +Change a value with: cmake -D\<Variable\>=\<Value\>, E.g. + +```bash +cmake .. -DWITH_SYSTEMD=ON -DWITH_SYSTEMD_JOURNAL=ON -DCMAKE_INSTALL_PREFIX=/usr +``` + +## General Options + +Option | Value | Comment +:--- | :--- | :--- +BUILD\_SHARED\_LIBS | ON | Set to OFF to build static libraries +DLT\_IPC |"FIFO" | Set to either "UNIX\_SOCKET" or "FIFO" +WITH\_DLT\_USE\_IPv6 | ON | Set to ON for IPv6 support +WITH\_DLT\_EXAMPLES | ON | Set to ON to build src/examples binaries +DLT\_USER | genivi | Set user for process not run as root +WITH\_CHECK\_CONFIG\_FILE | OFF | Set to ON to create a configure file of CheckIncludeFiles and CheckFunctionExists +CMAKE\_INSTALL\_PREFIX | /usr/local +CMAKE\_BUILD\_TYPE | RelWithDebInfo +WITH\_UDP\_CONNECTION | OFF | Set to ON to enable dlt UDP multicast SUPPORT +WITH\_DLT\_DAEMON\_VSOCK\_IPC | OFF | Set to ON for VSOCK support in daemon. +WITH\_DLT\_LIB\_VSOCK\_IPC | OFF | Set to ON for VSOCK support in libdlt (DLT\_IPC is overridden in libdlt). +DLT\_VSOCK\_PORT | 13490 | Port to use for VSOCK communication. + +## Command Line Tool Options + + Option | Value | Comment + :--- | :--- | :--- +WITH\_DLT\_ADAPTOR | OFF | Set to ON to build src/adaptor binaries +WITH\_DLT\_CONSOLE | ON | Set to ON to build src/console binaries +WITH\_DLT\_SYSTEM | OFF | Set to ON to build src/system binaries +WITH\_DLT\_LOGSTORAGE\_CTRL\_UDEV | OFF | PROTOTYPE! Set to ON to build +WITH\_DLT\_KPI | OFF | Set to ON to build src/kpi binaries + +## Linux OS Integration Options + + Option | Value | Comment + :--- | :--- | :--- +WITH\_SYSTEMD | OFF | Set to ON to run CMakeLists.txt in systemd +WITH\_SYSTEMD\_WATCHDOG | OFF | Set to ON to use the systemd watchdog in dlt-daemon +WITH\_SYSTEMD\_JOURNAL | OFF | Set to ON to use the systemd journal in dlt-system +WITH\_DLT\_DBUS | OFF | Set to ON to build src/dbus binaries + +## QNX OS Integration Options + +Option | Value | Comment +:--- | :--- | :--- +WITH\_DLT\_QNX\_SYSTEM | OFF | Set to ON to build QNX system binary dlt-qnx-system + +## Documentation Options + +Option | Value | Comment + :--- | :--- | :--- +WITH\_DOC | OFF | Set to ON to build API documentation +WITH\_MAN | OFF | Set to ON to build man pages + +## Test Options + +Option | Value | Comment +:--- | :--- | :--- +WITH\_TESTSCRIPTS | OFF | Set to ON to run CMakeLists.txt in test scripts +WITH\_DLT\_TESTS | ON | Set to ON to build src/test binaries +WITH\_DLTTEST | OFF | Set to ON to build with modifications to test User-Daemon communication with corrupt messages +WITH\_DLT\_UNIT\_TESTS | OFF | Set to ON to build unit test binaries +WITH\_GPROF | OFF | Set \-pg to compile flag + +## Experimental Features Options (Dragons ahead!) + +Option | Value | Comment +:--- | :--- | :--- +WITH\_DLT\_SHM\_ENABLE | OFF | Set to ON to enable shared memory as IPC +WITH\_DLT\_CXX11\_EXT | OFF | Set to ON to build C++11 extensions +WITH\_DLT\_COREDUMPHANDLER | OFF | Set to ON to build src/core\_dump\_handler binaries. diff --git a/doc/dlt_demo_setup.md b/doc/dlt_demo_setup.md new file mode 100644 index 0000000..3d357f4 --- /dev/null +++ b/doc/dlt_demo_setup.md @@ -0,0 +1,88 @@ +# DLT Demo Setup +Back to [README.md](../README.md) + +In this document you will run an instance of +dlt-daemon. It silently waits to collect and buffer log messages that are +produced by one or multiple DLT users. You will run one of those DLT users and +make it produce log messages that are sent to the daemon. Eventually, you launch +a client that collects and displays these messages. + +*Note: We assume that you installed DLT (i.e. executed the [two optional steps +after build](../README.md#build-and-install)). Otherwise you have to take care +of the executable paths and explicitly state the library path.* + +## Run the DLT Daemon +The DLT daemon is highly configurable but for this case the default settings are +okay. Don't be put off by warning messages: +```bash +$ dlt-daemon +[1886222.668006]~DLT~32290~NOTICE ~Starting DLT Daemon; DLT Package Version: 2.18.0 STABLE, Package Revision: v2.18.1, build on Dec 8 2020 11:11:51 +-SYSTEMD -SYSTEMD_WATCHDOG -TEST -SHM + +[1886222.668651]~DLT~32290~INFO ~FIFO size: 65536 +[1886222.668764]~DLT~32290~INFO ~Activate connection type: 5 +[1886222.668897]~DLT~32290~INFO ~dlt_daemon_socket_open: Socket created +[1886222.669047]~DLT~32290~INFO ~dlt_daemon_socket_open: Listening on ip 0.0.0.0 and port: 3490 +[1886222.669159]~DLT~32290~INFO ~dlt_daemon_socket_open: Socket send queue size: 16384 +[1886222.669355]~DLT~32290~INFO ~Activate connection type: 1 +[1886222.669509]~DLT~32290~INFO ~Activate connection type: 9 +[1886222.669644]~DLT~32290~INFO ~Ringbuffer configuration: 500000/10000000/500000 +[1886222.669924]~DLT~32290~NOTICE ~Failed to open ECU Software version file. +[1886222.670034]~DLT~32290~INFO ~Activate connection type: 6 +[1886222.670188]~DLT~32290~INFO ~Switched to buffer state for socket connections. +[1886222.670365]~DLT~32290~WARNING ~dlt_daemon_applications_load: cannot open file /tmp/dlt-runtime-application.cfg: No such file or directory +``` +The daemon opened a named pipe from which it is ready to read and buffer log +messages. It also accepts connections on TCP port 3490 by clients to collect +the messages. + +## Produce Log Messages +A simulated ECU - a DLT user - will now use the DLT library to create log +messages and send them through the named pipe for the daemon to collect. Open a +second terminal and run +```bash +$ dlt-example-user -n 5 -l 3 "This is my first log message" +Send 0 This is my first log message +Log level changed of context TEST, LogLevel=4, TraceState=0 +Log level changed of context TS1, LogLevel=4, TraceState=0 +Log level changed of context TS2, LogLevel=4, TraceState=0 +Send 1 This is my first log message +Client disconnected! +Send 2 This is my first log message +Send 3 This is my first log message +Send 4 This is my first log message +``` +This will send 5 (```-n 5```) identical log messages of Log-Level +WARNING ```(-l 3)``` containing a string payload. + +## Read logs +The DLT daemon now has the messages in its buffer and will keep them there until +they are fetched. A mighty tool for receiving and processing log messages is the +[DLT-Viewer](https://github.com/GENIVI/dlt-viewer), which also provides a +graphical UI. For now, a simple command line client is absolutely sufficient: +```bash +$ dlt-receive -a localhost +2020/04/30 12:27:14.976731 17134987 000 ECU1 DA1- DC1- control response N 1 [service(3842), ok, 02 00 00 00 00] +2020/04/30 12:27:14.976779 17067139 000 ECU1 DA1- DC1- control response N 1 [service(3842), ok, 01 00 00 00 00] +2020/04/30 12:27:14.976787 17067139 004 ECU1 DLTD INTM log info V 1 [Client connection #7 closed. Total Clients : 0] +2020/04/30 12:27:14.976794 17104625 005 ECU1 DLTD INTM log info V 1 [ApplicationID 'LOG' registered for PID 5241, Description=Test Application for Logging] +2020/04/30 12:27:14.976802 17104625 000 ECU1 DA1- DC1- control response N 1 [get_log_info, 07, 01 00 4c 4f 47 00 01 00 54 45 53 54 ff ff 18 00 54 65 73 74 20 43 6f 6e 74 65 78 74 20 66 6f 72 20 4c 6f 67 67 69 6e 67 1c 00 54 65 73 74 20 41 70 70 6c 69 63 61 74 69 6f 6e 20 66 6f 72 20 4c 6f 67 67 69 6e 67 72 65 6d 6f] +2020/04/30 12:27:14.976823 17104625 000 ECU1 DA1- DC1- control response N 1 [get_log_info, 07, 01 00 4c 4f 47 00 01 00 54 53 31 00 ff ff 1b 00 54 65 73 74 20 43 6f 6e 74 65 78 74 31 20 66 6f 72 20 69 6e 6a 65 63 74 69 6f 6e 1c 00 54 65 73 74 20 41 70 70 6c 69 63 61 74 69 6f 6e 20 66 6f 72 20 4c 6f 67 67 69 6e 67 72 65 6d 6f] +2020/04/30 12:27:14.976844 17104625 000 ECU1 DA1- DC1- control response N 1 [get_log_info, 07, 01 00 4c 4f 47 00 01 00 54 53 32 00 ff ff 1b 00 54 65 73 74 20 43 6f 6e 74 65 78 74 32 20 66 6f 72 20 69 6e 6a 65 63 74 69 6f 6e 1c 00 54 65 73 74 20 41 70 70 6c 69 63 61 74 69 6f 6e 20 66 6f 72 20 4c 6f 67 67 69 6e 67 72 65 6d 6f] +2020/04/30 12:27:14.976866 17104588 000 ECU1 LOG- TEST log warn V 2 [0 This is my first log message] +2020/04/30 12:27:14.976872 17109592 001 ECU1 LOG- TEST log warn V 2 [1 This is my first log message] +2020/04/30 12:27:14.976880 17114599 002 ECU1 LOG- TEST log warn V 2 [2 This is my first log message] +2020/04/30 12:27:14.976884 17119607 003 ECU1 LOG- TEST log warn V 2 [3 This is my first log message] +2020/04/30 12:27:14.976889 17124611 004 ECU1 LOG- TEST log warn V 2 [4 This is my first log message] +2020/04/30 12:27:14.976894 17134988 006 ECU1 DLTD INTM log info V 1 [New client connection #8 established, Total Clients : 1] +2020/04/30 12:27:15.442016 17139641 000 ECU1 DA1- DC1- control response N 1 [service(3841), ok, 4c 4f 47 00 54 45 53 54 72 65 6d 6f] +2020/04/30 12:27:15.442044 17139642 007 ECU1 DLTD INTM log info V 1 [Unregistered ApID 'LOG'] +``` +The client connects to the default port 3490 of localhost to collect all +messages and interprets the payload as ASCII text (```-a```). You can see lots +of additional messages. These are control messages to control the flow between +client and daemon. You will learn about them later. For now, you have set up a +basic example have seen DLT in action. + +You can now experiment with this setup. What happens if you start the DLT user +first and (while the DLT user is still running) the daemon?
\ No newline at end of file diff --git a/doc/dlt_glossary.md b/doc/dlt_glossary.md index 06f0cb9..843b9ab 100644 --- a/doc/dlt_glossary.md +++ b/doc/dlt_glossary.md @@ -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. |