summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Contact information updatedevel_contact_info_updateSaya Sugiura2021-03-161-1/+1
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* dlt-receive: Add option to configure port of dlt receive (#293)Alex2021-03-162-2/+15
| | | Signed-off-by: Alexander Mohr <git@mohr.io>
* Add verbose mode attribute handling (#292)Martin Willers2021-03-167-531/+1376
| | | | | | dlt_user_log_write_*_attr() enables to writing these types, but also support adding "attributes" for them, i.e. a "name" and a "unit". Signed-off-by: Martin Willers <M.Willers@gmx.net>
* Resolving broken link in README (#297)Darian Biastoch2021-03-111-2/+2
| | | Signed-off-by: dbiastoch <dbiastoch@de.adit-jv.com>
* fscanf() uses dynamic formatting to prevent buffer overflow (#288)Kevin-Luong2021-01-291-2/+5
| | | | | | | CVE: CVE-2020-29394 Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com> Co-authored-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* Make dlt pipe only readable by user (#285)Mostafa2021-01-191-1/+1
| | | | | | security-wise dlt pip(FIFO) should be exclusively readable only by owner not the dlt group to prevent eavesdropping by clients Signed-off-by: Mostafa Emami <mustafaemami@gmail.com>
* dlt_client_main_loop running in an infinite loop restricts graceful exit of ↵Sreeharsha Ramanavarapu2021-01-083-2/+42
| | | | | | | | | | | | | | | | | | | | | | | DLT Client code (#284) Issue: ------ dlt_client_main_loop currently uses an infinite loop ("while (1)"). This creates problems when a DLT client is running in a thread as part of a larger application. Graceful exit (for example: during object destruction) is not possible because a thread is running dlt_client_main_loop in the background. It is also not possible to exit the client, if we want it to fetch only a pre-decided number of messages. Solution: --------- Allow user to define a callback function to check whether the next message should be fetched. dlt-test-client.c has a new option to fetch a pre-decided number of messages, after which the client will exit. Signed-off-by: Sreeharsha Ramanavarapu <sreeharsha.r@gmail.com>
* Update ReleaseNotes and version to v2.18.6v2.18.6Saya Sugiura2021-01-062-2/+70
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* doc: Limitation to SIGUSR1 usage on AndroidSaya Sugiura2021-01-062-0/+12
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* gtest_dlt_common: fix seg fault when using memcpy().Dinh Cong Toan2021-01-062-5/+11
| | | | | | | | - Checking size of buffer and size of message before using memcpy(). - Adding configuration file for testfilter in /tests/CMakeLists.txt. Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
* example: Added customization of CxtID and AppIDdbiastoch2021-01-062-5/+126
| | | | | | | | -It's now possbile to enter a custom app and context ID by using the new implemented "-A" and "-C" arguments. -Also added a markdown manual in the doc directory for dlt-example-user. Signed-off-by: dbiastoch <dbiastoch@de.adit-jv.com>
* other: fix remaining conversion warningsDinh Cong Toan2021-01-0616-97/+97
| | | | | | | | | | | - Converting datatype to the correct one. - As macro do not perform type-checking before, so these functions used it with different datatype could create a lot of conversion warnings. For this reason, these warnings could be consider as normal information and will not be fixed. Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
* library: fix conversion warningsDinh Cong Toan(RBVH/ECM12)2021-01-066-106/+130
| | | | | | | | | | | | - Change the data type of variable 'size' in DltContextData struct (dlt_user.h.in). Variable 'size' was used repeated with function 'sizeof()' many time, so change type to 'size_t' can avoid a lot of warnings. - Adding temporary variable to calculate the datasize header (define in dlt_common.h) in 'dlt_common.c' file. Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <Toan.DinhCong@vn.bosch.com>
* tests: fix conversion warningsiod1hc2021-01-069-55/+55
| | | | | | - Casting data type to the right format. Signed-off-by: Dinh Cong Toan <Toan.DinhCong@vn.bosch.com>
* daemon: fix conversion warningsiod1hc2021-01-069-166/+179
| | | | | | | | | | | | | - Instead of casting frequently, change the data type of 'to_remove' to 'uint32_t' for the correct format, also adding temp variable to check return value. - Change data type of 2 variable 'offset' and 'sizecont' to 'size_t' (dlt_daemon_client.c), because these variable using many time with function 'sizeof', and they was used as local variable so it will not effect dlt library. Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
* shared: fix conversion warningsiod1hc2021-01-063-74/+74
| | | | | | | | | | | - Data type of 'textlength' create a lot of warnings while using in function 'snprintf()', so change data type to 'size_t' will resolve these warnings. - Change data type of variable 'size' to the right type 'unsigned int', which is located in struct DltBuffer in dlt_common.h (line 832). Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* logstorage: fix conversion warningsDinh Cong Toan(RBVH/ECM12)2021-01-062-65/+65
| | | | | | | | | | | | - Some functions like 'strncmp()', 'strncat()', 'strcpy()' and 'memcpy()' take an argument in type 'size_t', so explicit data type to 'size_t' in this case is needed to avoid conversion warnings. - Function 'strlen' return data type 'size_t', which still need to cast data type Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <Toan.DinhCong@vn.bosch.com>
* console :fix conversion warningsDinh Cong Toan(RBVH/ECM12)2021-01-069-48/+48
| | | | | | - Explicit type conversion from 'signed' to 'unsigned' Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <Toan.DinhCong@vn.bosch.com>
* gateway: fix compile warningsDinh Cong Toan(RBVH/ECM12)2021-01-065-36/+35
| | | | | | | | | - Correct the data type of 'headersize' and 'datasize' variables in header 'dlt_common.h', then config those functions using this library. - Explicit the data type. Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <Toan.DinhCong@vn.bosch.com>
* readme: cpack document for debian packageKHANH LUONG HONG DUY2021-01-061-0/+11
| | | | Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* CMakeList: implement cpack for debian packageKHANH LUONG HONG DUY2021-01-061-0/+6
| | | | | | Introduce cpack options to build DLT debian package Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* dlt-receive: flush stdout buffer by signalKHANH LUONG HONG DUY2021-01-061-1/+29
| | | | | | | | | | | When dlt-receive logs is redirecting to file then a terminating signal is sent to dlt-receive, it will stop without flushing all logs from stdout to file, due to the default size of stdout is 4096 byte. When dlt-receive receive the SIGTERM or SIGINT, it flushes stdout buffer to stdout before terminating. Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* gtest: Include necessary headerssugiura2021-01-061-99/+17
| | | | | | | | | This commit includes following headers which defines maximum and minimum value. - stdint.h - float.h Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* doc: Update doc for the maintain logstorage loglevel implementationKHANH LUONG HONG DUY2021-01-061-1/+24
| | | | Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* logstorage: Implement general config to maintain logstorage loglevelSaya Sugiura2021-01-068-5/+163
| | | | | | | | | | | | Runtime log level setting from dlt-viewer or dlt-control doesn't work when logstorage is enabled. Adding MaintainLogstorageLogLevel=ON/OFF to [General] session of dlt_logstorage.conf to keep the current behaviour (=ON or 1 or not defined), or allow to change log level from dlt-viewer or dlt-control when the logstorage is enabled (=OFF or 0). Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com> Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* daemon: Correct order of runtime config load.Bui Nguyen Quoc Thanh2021-01-063-12/+24
| | | | | | | | Since order of runtime config load for app-ctx and dlt-runtime are different from each other, so they could not be in the same load_runtime function. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* libdlt: Use SIGUSR1 for thread on AndroidBui Nguyen Quoc Thanh2021-01-062-5/+36
| | | | | | | Since bionic does not support pthread_cancel(), try to terminate housekeeper thread via SIGUSR1. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* dlt-daemon: log levels are not controlledBui Nguyen Quoc Thanh2021-01-062-31/+33
| | | | | | | | | | | | | | | | The issue happens in case: dlt_logstorage.conf is set available at startup via dlt.conf and both LogAppName and ContextName are wildcard. In such a case, when logstorage disconnection happens, dlt-daemon is missing a check for case in which both are wildcard. It causes the reset loglevel is not happening. Then the control message to change loglevel will be handled incorrectly. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* dlt-daemon: complete logstorage path with '/'Bui Nguyen Quoc Thanh2021-01-061-5/+53
| | | | | | | | | | | | | | | | | | Currently, the logstorage device cannot be disconnected if "/" is appended at the end of path. For example: int dlt.conf, the configuration is: OfflineLogstorageDirPath = /var/log/dlt_raw Then the control message as below won't work. "dlt-logstorage-ctrl -c 0 -p /var/log/dlt_raw/" The fix is to get the information the requested mount point via stat() to ensure the path of connected/disconnected control messages are validated properly. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* libdlt: Use poll to avoid CPU high loadBui Nguyen Quoc Thanh2021-01-061-29/+49
| | | | | | | | | | | | | Use timeout of polling as time for retry. In case of timeout or failure of polling, continue to close the socket. It could take some times to get the socket is shutdown So it means there could be some data available to read. Try to consume the data and poll the socket again. If read fails, time to close the socket then. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* libdlt: Flush all data in atexit_handlerSaya Sugiura2021-01-061-13/+43
| | | | | | | | | | | | | | | | | Current implementation had two issues: - Remaining data in startup_buffer wasn't able to be sent to daemon even dlt_user.timeout_at_exit_handler was set to more than 0 - Socket could be closed before all the data was sent to daemon To solve this: - dlt_unregister_app_flush_buffered_logs() won't clean appIDs if any data is remaining in startup_buffer. atexit_handler will be in charge of cleaning them - Socket won't be closed if data wasn't sent due to errno EAGAIN or EWOULDBLOCK. It retries until execution count reaches to maximum DLT_USER_MAX_RETRY_COUNT (1000 as default) Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* dlt-convert: replace system() by dlt_execute_command()KHANH LUONG HONG DUY2021-01-061-13/+12
| | | | Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* dlt_common: Execute system command using execvpKHANH LUONG HONG DUY2021-01-062-0/+63
| | | | | | | Add function dlt_execute_command() to execute system command using execvp. Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* logstorage: snprintf return checkSaya Sugiura2021-01-061-2/+4
| | | | | | | | | | snprinf will return the number of characters printed if succeeded. related commits: 0ae98e7 snprintf ret > 0 is not always an error 676e8fc fix some gcc9 compiler warnings Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* logstorage: Update unit testSaya Sugiura2021-01-061-15/+166
| | | | | | | | | | Following functions are updated due to interface and structure changes: - dlt_logstorage_sort_file_name - dlt_logstorage_rearrange_file_name - dlt_logstorage_prepare_on_msg Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* logstorage: Add debug logsSaya Sugiura2021-01-062-3/+31
| | | | | | | | This commit adds debug logs for opening and scanning DLT log files in Logstorage device. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* logstorage: Modify rearranging fileSaya Sugiura2021-01-061-1/+10
| | | | | | | | | | | | | | This commit updates dlt_logstorage_rearrange_file_name() to perform following: - If the maximum index isn't equal to maxcounter, do not rearrange the file name - If the maximum index reaches to maxcounter: - If minimum index is not 1, do not rearrange the file name - If minimum index is 1, check if there's any indexes which the gap is more than 1. If exists, take those indexes as latest and oldest. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* logstorage: Handle wrap-aroundSaya Sugiura2021-01-065-52/+158
| | | | | | | | In case there is wrap-around, the newest file must be decided based on the biggest wrap_id and corresponding working filename. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com> Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <Toan.DinhCong@vn.bosch.com>
* libdlt: support short versionBui Nguyen Quoc Thanh2021-01-062-2/+9
| | | | | | Use cmake option to support version with major number only. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* design doc: update spec for new environment variableBui Nguyen Quoc Thanh2021-01-061-0/+6
| | | | Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* doc: update disable injection msg for developerBui Nguyen Quoc Thanh2021-01-061-0/+16
| | | | Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* libdlt: disable injection msg via env varBui Nguyen Quoc Thanh2021-01-063-3/+14
| | | | | | | | | | | | | | In order to disable injection message at dlt user, set DLT_DISABLE_INJECTION_MSG_AT_USER to any value. When injection message is disabled, libdlt won't poll any data from receiver. It means libdlt will ignore all data/messages from dlt-daemon. By default, variable is unset so that dlt users are able to handle data/messages from dlt-daemon. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* doc: Rewrote the DLT user documentation.Sebastian Unger2021-01-064-130/+293
| | | | | | | | - 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>
* daemon: Alternative of timerfd in QNXBui Nguyen Quoc Thanh2021-01-062-32/+184
| | | | | | | There is no timerfd_create in QNX so try to use threads to sleep and notify to main thread via unamed pipes. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* bug-fix: fix invalid file descriptor checkAlexander Mohr2021-01-062-4/+9
| | | | | | | | | | | Some functions validated file descriptor to be greater 0. If a process is started without stdin, stdout and stderr the first file descriptor allocated by the process will be 0. This also will be the case if the above mentioned file descriptors will be closed on purpose. As 0 is a valid fd, some methods had to be changed to reflect this. Signed-off-by: Alexander Mohr <alexander.m.mohr@daimler.com>
* dlt_user: fix invalid poll timeoutAlexander Mohr2021-01-062-7/+5
| | | | | | | | | | | | | | The poll timeout was only set for fifo. TCP connections require this timeout as well. dlt_user_log_check_user_message also validated the file descriptor to be greater 0. Because 0 is a valid file descriptor this check has been changed to greater or equal 0. poll receives a timeout in milliseconds. The given paramter was in nanoseconds. An additional define takes adds the delay in miliseconds. Signed-off-by: Alexander Mohr <alexander.m.mohr@daimler.com>
* README: Switch from travis-ci.org to travis-ci.comSaya Sugiura2020-12-161-1/+1
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Add support for logging with VSOCK (#255)Martin Ejdestig2020-12-1419-224/+428
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For more information about VSOCK, see "man vsock" ( https://man7.org/linux/man-pages/man7/vsock.7.html ). Makes it possible for processes in a virtual machine to log directly in DLT running on host without setting up a network connection between guest and host. It is also probably more efficient. Have not done any performance measurements (not main reason for patch), but no forwarding is required as when running DLT in a multi-node setup. When building dlt-daemon for host, WITH_DLT_DAEMON_VSOCK_IPC should be enabled for daemon to listen on incoming VSOCK requests. Local communication method between applications and daemon is still determined with DLT_IPC. When building for guest, WITH_DLT_LIB_VSOCK_IPC should be enabled and DLT_IPC will be ignored, which will make libdlt open a VSOCK socket to the deamon for logging messages. VSOCK can be tested without a virtual machine. Since VMADDR_CID_HOST is used by libdlt when connecting, see vsock man page, clients can be run on host to test VSOCK communication. Some modifications has been done to be able to handle logging through FIFO pipe and socket in the same build of dlt-daemon: - dlt_receiver_init/free_unix_socket() is renamed to dlt_receiver_init/free_global_buffer() and used for FIFO as well. Also fixes memory leak since dlt_receiver_free_unix_socket() was used regardless of whether DLT_USE_UNIX_SOCKET was defined or not. - Pass type to dlt_receiver_init() instead of dlt_receiver_receive(). And remove preprocessor conditionals for handling DLT_CONNECTION_APP_MSG in dlt_daemon_process_user_messages(). Also fixes wrong enum type being passed to dlt_receiver_receive() in dlt_client.c (DltClient::mode was used as a DltReceiverType enum but it is a DltClientMode enum). - Add a flag to DltDaemonApplication to indicate whether file descriptor is "owned" by the DltDaemonApplication or not. When dlt_daemon_application_add() is called due to message received on a socket, fd is passed as an argument (app does not own fd). For FIFO, a per application FIFO is opened (app owns the fd). Also fixes so that user handle is reset for both application and all its contexts when resetting any. Prevents fd from being used by accident after it has been closed. dlt_mkdir_recursive() is moved to src/daemon since it is only used in the daemon. Minimizes use of DLT_USE_UNIX_SOCKET_IPC. Other bugfixes: - Call DLT_SEM_FREE() if setting socket to O_NONBLOCK fails in src/lib/dlt_user.c:dlt_initialize_socket_connection(). - Close socket if dlt_receiver_init() fails in src/lib/dlt_user.c:dlt_initialize_socket_connection(). Signed-off-by: Martin Ejdestig <martin.ejdestig@volvocars.com>
* Use dlt_defaults for dlt-logd-converter in Android.bp (#271)Martin Ejdestig2020-12-081-3/+1
| | | Signed-off-by: Martin Ejdestig <martin.ejdestig@volvocars.com>
* dlt-control.c: return -1 on error (#259)Moritz Warning2020-12-081-12/+40
| | | Signed-off-by: Moritz Warning <moritzwarning@web.de>