summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* common: Isolate FIFO/Unix socketLUONG HONG DUY KHANH(RBVH/ENG42)2020-07-063-7/+40
| | | | | | | | | | | | | | dlt_common - Add preprocessor DLT_USE_UNIX_SOCKET_IPC for dlt_log_set_fifo_basedir() and dltFifoBaseDir variable - Rename input parameter of dlt_log_set_fifo_basedir() dlt-daemon - Replace setting dltFifoBaseDir by dlt_log_set_fifo_basedir() and add preproc DLT_USE_UNIX_SOCKET_IPC - Update -h opt and flags.loggingFilename based on IPC type Signed-off-by: LUONG HONG DUY KHANH(RBVH/ENG42) <KHANH.LUONGHONGDUY@vn.bosch.com>
* libdlt: Relocate dltFifoBaseDir settingLUONG HONG DUY KHANH(RBVH/ENG42)2020-07-062-3/+3
| | | | | | | Relocate the setting of dltFifoBaseDir variable from dlt_init() to dlt_check_envvar() Signed-off-by: LUONG HONG DUY KHANH(RBVH/ENG42) <KHANH.LUONGHONGDUY@vn.bosch.com>
* doc: md file for dlt_gateway.confBui Nguyen Quoc Thanh2020-07-065-26/+136
| | | | Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* network trace: Include necessary headersSaya Sugiura2020-07-069-16/+3
| | | | | | | | | | | Some components which links dlt seem to depend on following headers, which will be included by mqueue.h. - sys/types.h - fcntl.h So explicitly include them if mqueue interface is not supported in dlt_user.h. Also two headers are removed if dlt_used.h is included. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* network trace: Add mqueue verificationSaya Sugiura2020-07-068-23/+115
| | | | | | | | | | There is some OS (e.g. Android) which doesn't support message queue. Since network trace uses it as IPC, we need to disable it if following calls are not available: mq_open, mq_close, mq_unlink, mq_send, mq_receive Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* Unittest for new apiBui Nguyen Quoc Thanh2020-07-061-1/+55
| | | | | | | Add two new testcases in tests/gtest_dlt_common.cpp for dlt_file_quick_parsing() Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* Remove duplicate definition of DLT_CONVERT_TEXTBUFSIZEBui Nguyen Quoc Thanh2020-07-061-1/+0
| | | | Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* Improve performance of DLT file parsingBui Nguyen Quoc Thanh2020-07-062-0/+83
| | | | | | Introduce new API to support quick parsing a DLT file. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* relocation dlt_check_envvar() and update dlt_init() functionsLUONG HONG DUY KHANH(RBVH/ENG42)2020-07-061-6/+6
| | | | Signed-off-by: LUONG HONG DUY KHANH(RBVH/ENG42) <KHANH.LUONGHONGDUY@vn.bosch.com>
* Redirect stdout to stderrLUONG HONG DUY KHANH(RBVH/ENG42)2020-07-065-21/+69
| | | | | | | | | | | | - daemon: New feature for LoggingMode at /etc/dlt.conf to be able to set value at 3 in order to redirect all stdout messages to stderr. - libdlt: New feature for DLT_LOG_MODE environment variable to be able to set value at 3 in order to redirect all stdout messages to stderr. - unit test: Add test cases for DLT_LOG_TO_STDERR Signed-off-by: LUONG HONG DUY KHANH(RBVH/ENG42) <KHANH.LUONGHONGDUY@vn.bosch.com>
* Unittest: Update testcaseBui Nguyen Quoc Thanh2020-07-063-2/+21
| | | | | | | | | gtest_dlt_daemon_gateway is updated to test for both cases: "With and Without General section in dlt_gateway.conf" Timeout=0 is now endless retry. So change it to "-1" Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* gateway: Improvement of handling Gateway configBui Nguyen Quoc Thanh2020-07-063-11/+51
| | | | | | | | | | | | | | In the current implementation, we believe in user to treat General section as Mandatory. Hence system could be reset due to memory of connections incorrectly. At the moment, General could be handled as Optional with default value of interval. It means General could be absent from config file. Improvement is to raise WARNING to user, set default value and update the number of connections properly. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* daemon: Avoid spamming message buffer overflowBui Nguyen Quoc Thanh2020-07-062-20/+9
| | | | | | | | | | | | | - In existing implementation, control message "message_buffer_overflow" is sent for every incoming message which is dropped since buffer is full. So UDP and logstorage will receive a lot of these messages. That could be considered as unnecessary. - In order to reduce the useless effort to send "message_buffer_overflow" for every missing message, daemon will only send it out right after buffer is full or right after real client is connected. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* gateway: Support infinite loop of retryBui Nguyen Quoc Thanh2020-07-062-6/+17
| | | | | | | | | | | - In order to enable endless retry of reconnection, "Timeout" in dlt_gateway.conf must be set to 0. - In case of "Timeout" is an integer A and A is greater than 0, so after A times of retry, the connection to passive Node will be marked as DISABLED. There won't be any retry afterward. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* gateway: Configurable interval timeBui Nguyen Quoc Thanh2020-07-065-47/+172
| | | | | | | | | - Introduce "General" section for dlt_gateway.conf - In new section, the interval is used for gateway timer. This entry is optional. By default, it is set to 1 second as the existing hardcoded value. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* tests: remove unused zlib includeFelix Herrmann2020-07-061-1/+0
| | | | | | | Include in dlt-test-receiver introduces zlib dependency. It can be removed as it is not used. Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
* disable android services by defaultFelix Herrmann2020-07-062-0/+2
| | | | Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
* logstorage: Add NULL check of IDsSaya Sugiura2020-07-061-1/+2
| | | | | | | | | | | | | There is a missing NULL check for APID and CTID in dlt_logstorage_create_keys() function in following condition: - APID is wildcard - CTID is wildcard - ECUID is set Related commit: 557624f SOPL-8567: daemon: logstorage with wildcards Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* snprintf ret > 0 is not always an errorFelix Herrmann2020-07-061-6/+12
| | | | | | | | | snprintf returns the size the resulting string would take. In order to detect truncation, this size needs to be checked against the buffer size. Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com> Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* fix some gcc9 compiler warningsFelix Herrmann2020-07-069-79/+92
| | | | | | | | | Many stringop-truncation and stringop-overflow warnings are still there (so many). https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/ Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com> Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* fix clang warnings about GNU stuffFelix Herrmann2020-07-064-42/+36
| | | | | Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com> Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* android logd forwarderFelix Herrmann2020-07-065-2/+276
| | | | Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
* fix gateway config element searchFelix Herrmann2020-07-061-5/+4
| | | | | | | Only the first configured passive node was checked when a connection request was issued. Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
* doc: update a note for logstorage with wildcardBui Nguyen Quoc Thanh2020-07-061-0/+3
| | | | | | | If both of the parameter "LogAppName" and "ContextName" are set to wildcard or not present in the configuration file, "EcuID" must be specified. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* daemon: logstorage with wildcardsBui Nguyen Quoc Thanh2020-07-061-4/+6
| | | | | | | | | | | | In the current implementation, if FILTER section is setting wildcard for both "LogAppName" and "ContextName", it will be ignored. But it is still a valid configuration for NON-VERBOSE. In order to consolidate the daemon's behavior, the combination of wildcard for both "LogAppName" and "ContextName" in FILTER section will be treated as only ECUID is specified. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* Limit log messages on full bufferFelix Herrmann2020-07-062-5/+10
| | | | Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
* Android: Enable Android buildFelix Herrmann2020-07-066-10/+287
| | | | | Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com> Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* logstorage: Filter section handlingSaya Sugiura2020-07-061-53/+48
| | | | | | | | | | | | When following filter is used, dlt-daemon gives an error message even it's using optional sections: NON-VERBOSE-STORAGE-FILTER NON-VERBOSE-LOGLEVEL-CTRL This commit fixes to check if the section is optional or not and just gives debug message if it's optional. Also, new static function is introduced to harmonize all the behavior in logstorage filter. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* doc: Logstorage non-verbose filterSaya Sugiura2020-07-061-1/+39
| | | | | | Add explanation and example to non-verbose filter. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* correct errno usage in dlt_stop_threadsVo Trung Chi2020-07-061-11/+6
| | | | | | | | | | | Most pthreads functions return 0 on success, and an error number on failure. Note that the pthreads functions do not set errno. Refer to man page of pthreads for detail. So we have to use the return value as the error number instead of errno variable. Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
* shared: Read DLT header until it's foundSaya Sugiura2020-07-061-13/+31
| | | | | | | | | Current dlt_file_read_header() function which is used for e.g. dlt-convert, dlt-sortbytimestamp, etc. stops finding DLT header if it's not available in the next file position. It is improved to read the header in a loop until it's found. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Use ssize_t for bytes_writtenBui Nguyen Quoc Thanh2020-07-061-1/+1
| | | | Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* Fix dlt-sortbytimestampBui Nguyen Quoc Thanh2020-07-061-4/+34
| | | | | | | | In case there is only one cycle of boot, perform sort by timestamp and write all messages out. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* Remove DLT_PACKED redefinition guard in dlt_common.hFelix Herrmann2020-07-061-3/+1
| | | | Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
* rename definition PACKED to DLT_PACKEDFelix Herrmann2020-07-064-47/+39
| | | | | Signed-off-by: Felix Herrmann <external.Felix.Herrmann3@de.bosch.com> Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* daemon: Remove empty line in daemon logSaya Sugiura2020-07-061-16/+17
| | | | | | | New empty line was generated from daemon internal log because of '\n'. This is removed from daemon internal log and added to dlt_vlog(). Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Revert "dlt_common: Fix buffer overflow in dlt_buffer_get (#215)"Saya Sugiura2020-06-161-4/+2
| | | | This reverts commit e420ee62d89d5efab6ad7275910cb3eec8497da6.
* FIX: prevent usage of uninitialized message queue handleRudolf Svanda2020-05-181-1/+3
| | | | | | | | | Problem occurs always if application exits and dlt_user.dlt_segmented_queue_read_handle is not initialized. Warning "NWTSegmented: Error while reading queue" is printed on terminal on embedded devices. Signed-off-by: Rudolf Svanda <rudolf.svanda@globallogic.com>
* Add unit tests for new sized string functionsMartin Willers2020-05-181-0/+100
| | | | Signed-off-by: Martin Willers <M.Willers@gmx.net>
* Add documentation for new sized string functionsMartin Willers2020-05-181-2/+34
| | | | Signed-off-by: Martin Willers <M.Willers@gmx.net>
* Add macro wrappers for new sized string functionsMartin Willers2020-05-181-0/+33
| | | | Signed-off-by: Martin Willers <M.Willers@gmx.net>
* Minor optimizationMartin Willers2020-05-181-1/+1
| | | | | | | There is no need to have both an array and a pointer to it; just use the array directly. Signed-off-by: Martin Willers <M.Willers@gmx.net>
* Add functions for writing strings with known sizesMartin Willers2020-05-182-0/+50
| | | | Signed-off-by: Martin Willers <M.Willers@gmx.net>
* Add helper function for writing strings with known sizesMartin Willers2020-05-181-3/+17
| | | | | | | | | | | This use case is common in C++ code nowadays, due to the usage of e.g. std::string_view, which does not provide a function for retrieving a null-terminated C-string, but which provides quick access to the string length via std::string_view::size(). Such use cases can now avoid an entirely unnecessary strlen() call. Signed-off-by: Martin Willers <M.Willers@gmx.net>
* Fixed empty internal message in dlt-daemon.c (#225)Francesco Montefoschi2020-04-291-1/+3
| | | | | | | | `dlt_daemon_log_internal` is called with with a null `local_str`. This has been introduced by mistake during a code refactoring. Code has been reverted to the previous version: https://github.com/GENIVI/dlt-daemon/commit/bfa7026b355db32d91374997cc86b56fedc3e861 Signed-off-by: Francesco Montefoschi <francesco.montefoschi@artgroup-spa.com>
* common: Fix uint64 type (#217)Saya Sugiura2020-04-021-1/+1
| | | | | | The log message was printed as a signed value for uint64 type. This commit fixes to print as an unsigned value. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* dlt_common: Fix buffer overflow in dlt_buffer_get (#215)Ricardo Leite2020-03-301-2/+4
| | | | | | A DLT lib user can create a message large enough that dlt_user.resend_buffer is not large enough, and thus it will overflow Signed-off-by: Ricardo Leite <rleite@dcc.fc.up.pt>
* FIX: Check validity of `file` pointer before usage.Sebastian Kloska2020-02-201-3/+3
| | | | | | | Check for file == null before accessing the pointer for a debug message Signed-off-by: Sebastian Kloska <sebastian.kloska@snafu.de>
* doc/dlt_for_developers.md: Fix wrong DLT include directiveSebastian Lipponer2020-02-111-1/+1
| | | | | | | | | | | | The include directive '#include <dlt/dlt.h>' that is stated in the developer guide (see 'doc/dlt_for_developers.md') does not work when the include path is set via the pkg-config file 'automotive-dlt.pc'. The include path set via this file requires users to use the include directive '#include <dlt.h>'. This is also in accordance with older DLT documentation. Signed-off-by: Sebastian Lipponer <mail@sebastianlipponer.de>
* Remove naming of variadic macro parametersTed Lyngmo2020-02-061-8/+8
| | | | | | | The GNU preprocessor supports naming of the variadic macro parameter, but not preprocessors does. Signed-off-by: Ted Lyngmo <ted@lyncon.se>