summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* dlt-daemon: fix resource leakPhong Tran2019-12-111-0/+2
| | | | | | | return without close the file descriptor. reported by Resource leak (RESOURCE_LEAK) Signed-off-by: Phong Tran <tranmanphong@gmail.com>
* console: fix memleak of dlt-logstorage-listPhong Tran2019-12-111-0/+2
| | | | | | report by coverity with Resource leak (RESOURCE_LEAK) Signed-off-by: Phong Tran <tranmanphong@gmail.com>
* BugFix: SEGFAULT when using AppArmor (#192)Sebastian Kloska2019-12-101-14/+17
| | | | | | | | | | | | | | | | | | | | | | | * Symptome: If access to the trace directory is not granted by AppArmor access(...) still reports otherwise. dlt_offline_trace_get_total_size(...) tries to open the dir via opendir(...) and tries a readdir without any further check, which results in an SEGFAULT * Solution: (1) Make dlt_offline_trace_get_total_size return ssize_t instead of unsigned long, which gives us a chance to return an error state (2) Check the return value from opendir(...) and bail out on error. Use this to return DLT_RETURN_ERROR in dlt_offline_trace_check_size. * ToDo: (1) Error state is not yet checked and reported back. On Error we just don't generate any offline log files without any further complain. (2) Find a replacement for access(...) which reports properly under AppArmor. (3) Report the confusing behaviour of access(...) to the AppArmor team. Signed-off-by: Sebastian Kloska <seebastian.kloska@snafu.de>
* Fix compiler warnings: pointer of type ‘void *’ used in arithmetic (#196)Sebastian Lipponer2019-12-103-13/+13
| | | Signed-off-by: Sebastian Lipponer <mail@sebastianlipponer.de>
* Change the DLT_CHECK_RCV_DATA_SIZE macro to an internal function (#191)Sebastian Lipponer2019-11-253-12/+22
| | | | | | | | | The use of this macro in a if condition is actually non-standard C++ code. GCC issues a warning that ISO C++ forbids braced-groups within expressions when compiled with -Wpedantic. Other compilers fail with an error. Change the macro to an internal function in order to improve the portability to other platforms (i.e. MSVC, proprietary embedded). Signed-off-by: Sebastian Lipponer <mail@sebastianlipponer.de>
* Fix a potential memory leak in file transfer (#126)Andreas2019-11-191-7/+11
| | | | | | | | | | * Fix a potential memory leak in file transfer This potential memory leak in dlt-system-filetransfer.c can happen if only a filename is passed to dirname(). In the current implementation of dlt-daemon, this issue cannot happen. But in case of refactoring or different usage there is a chance that it can be triggered. See: https://linux.die.net/man/3/dirname Signed-off-by: Andreas Seidl <andreas.seidl@daimler.com>
* Provide DLT_GET_APPID macro (#187) (#188)Vo Trung Chi2019-11-141-0/+11
| | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* dlt-offline-trace: fix bug and hardcode (#174) (#186)Vo Trung Chi2019-11-142-22/+38
| | | | | | | | Fix the issue that DLT offline trace creating mutiple files even after reaching MaxTrace size when filename is index based. Related to: https://github.com/GENIVI/dlt-daemon/pull/174 Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
* Avoided Seg fault in dlt_message_payload (#179) (#181)Vo Trung Chi2019-11-142-64/+70
| | | | | | | | | * Avoided Seg fault in dlt_message_payload (#179) Avoided Seg fault by adding boundary check before buffer access. Signed-off-by: Ravi Sankar P <ponnurangamravi.sankar@in.bosch.com> Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
* Improvement: Make ZLib dependency optional (#182)Sebastian Kloska2019-11-083-10/+22
| | | | | | | | * New CMake option WITH_DLT_FILETRANSFER * Only request ZLIB package if WITH_DLT_COREDUMPHANDLER==ON or WITH_DLT_FILETRANSFER==ON Signed-off-by: Sebastian Kloska <sebastian.kloska@snafu.de>
* fix the dlt offline trace file name creation (#178)Vo Trung Chi2019-10-291-13/+16
| | | | | | | The function dlt_offline_trace_file_name() use sizeof the pointer as the maximum file name size, so it cannot create the file name as expected. Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
* libdlt: fix memory leakVo Trung Chi2019-10-241-8/+20
| | | | | | | This commit is fixed the memory leak in case the dlt application do reattach to the daemon. Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
* Removed unused headers(epoll) in UDP connectionsunil.s2019-10-144-10/+21
| | | | Signed-off-by: sunil.s <sunil.s@lge.com>
* Fix: Propper usage of LoggingMode: "uncrustification"Sebastian Kloska2019-10-102-41/+35
| | | | Signed-off-by: Sebastian Kloska <sebastian.kloska@snafu.de>
* Fix: Propper usage of LoggingMode in ".../dlt-runtime.cfg"Sebastian Kloska2019-10-102-8/+12
| | | | | | | | | | | | | | | | | | * Symptom: no offline trace file gets created even if runtime config LoggingMode==(2|3). * Reason: runtime config gets read *after* offline logging setup. * Solution: Read runtime config *before* offline logging setup. * Make the "read runtime config" function set a proper default value for logging mode instead if the *_init_* function setting up the logging. Signed-off-by: Sebastian Kloska <sebastian.kloska@snafu.de>
* libdlt: reattachment and improvement in dlt thread (#171)Vo Trung Chi2019-10-012-110/+61
| | | | | | | | | | | | | | | | | Improvement: housekeeper thread with poll - Change name receiver thread to housekeeper thread - Use poll() in housekeeper thread to get new received message from DLT Daemon. - Remove resend buffer inside of dlt_user_log_reattach_to_daemon() - Only try to resend buffer if fd is valid. This commit removes the event driven dlt_user_log_reattach_to_daemon() that is called e.g. by DLT_LOG. Now, only the DLT housekeeper thread handles the retrial to attach to daemon. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: Simon Herkenhoff <sherkenhoff@jp.adit-jv.com> Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* dlt-system: Call tzset before localtime_r (#165)Saya Sugiura2019-09-236-0/+7
| | | | | | Since localtime() was calling tzset() internally, it should be used before localtime_r(). Refer to man page of localtime_r() for detail. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Bugfix: dlt-system-journalSebastian Kloska2019-09-131-5/+5
| | | | | | | * Don't pass a NULL pointer to localtime_r(...) and strftime(...) * Make sure that localtime_r(...) gets a pointer to time_t Signed-off-by: Sebastian Kloska <sebastian.kloska@daimler.com>
* Proper setup and error checking of pthread_createSebastian Kloska2019-09-138-77/+49
| | | | | | | | | | * Replace all start_XXX functions with one start_thread * Don't make pthread_t static * Don't use pthread_attr_t. Simply pass NULL * Bail out when pthread_create() fails * Check if MAX_THREADS gets exceeded Signed-off-by: Sebastian Kloska <sebastian.kloska@daimler.com>
* doxygen improvementSaya Sugiura2019-09-134-4/+4
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* cmake improvement for Logstorage consoleSaya Sugiura2019-09-131-15/+18
|
* cmake add component for libdlt.soFelix Herrmann2019-09-131-3/+8
| | | | Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
* parser: Change maximum number of config sectionVo Trung Chi2019-09-132-3/+3
| | | | | | This commit includes improvement of related code. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* dlt_common: Use defined macroVo Trung Chi2019-09-131-1/+1
| | | | Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* libdlt: calculate resend buffer memoryBui Nguyen Quoc Thanh2019-09-131-19/+29
| | | | | | | | | | | | | | The fix from commit 376bf6c is considered as a workaround. From now, the resend buffer size is calculated based on (dlt_user.log_buf_len + header_size) - Remove the macro DLT_USER_EXTRA_BUFF_SIZE - Use env_disable_extended_header_for_nonverbose instead of env_nonverbose_extended_header Related commit: 376bf6c Size of Resend buffer less than or equal to DLT_USER_BUF_MAX_SIZE res… (#116) Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* lib: Disable extended header in non verbose mode by env varOnkar Palkar2019-09-134-3/+523
| | | | | | | dlt-test-non-verbose test application is also added. Signed-off-by: Onkar Palkar <onkar.palkar@wipro.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
* shm: Resend dlt msg when client connectVo Trung Chi2019-09-136-282/+159
| | | | | | | | After dlt-client connects to dlt-daemon successfully, all the stored dlt messages in daemon was not flushed to dlt client when using shared memory as IPC. It is harmonized with dlt_daemon_process_user_message_log(). Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
* lib: Remove else nothingSaya Sugiura2019-09-131-2/+0
| | | | | | Remove "else nothing" to correct code behavior. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* network trace: Do not allow DLT usage in forked childVo Trung Chi2019-09-131-0/+4
| | | | | | | dlt_user_trace_network_segmented() shall not be used in forked child process. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* lib: Assign fd after it's closedSaya Sugiura2019-09-131-0/+1
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* console: Add get sw version control msgVo Trung Chi2019-09-132-83/+213
| | | | | | | | dlt-control command is extended to send get software version control message. e.g: dlt-control -k localhost Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* console: Tool to merge multiple DLT filesBui Nguyen Quoc Thanh2019-09-132-44/+279
| | | | | | | | | | | | | | - Sort in dlt-sortbytimestamp: first sorted by time, second sorted by timestamp. - Support multiple compressed files in dlt-convert. These changes is based on use case: User can expects to join several dlt files which are compressed in tar.gz file (maybe per component). Moreover, currently the existing sort is only applicaple for single boot cycle. There should be a support for sorting multiple cyclic boots in one dlt file. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* dlt-test: Add message length optionBui Nguyen Quoc Thanh2019-09-132-5/+45
| | | | | | | | | | | | | New option is introduced for binary dlt-test-multi-process. It is used to specify the length of message to be sent. By default, when no length is specified, the current sample message will be sent. It is also used in dlt-test-multi-process-client. Also fixes: - Legacy bug: MAX_THREADS instead of MAX_PROCS - Correct coding style Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* Add user custom timestamp interfaceSebastian Unger2019-09-136-12/+120
| | | | | | | | | | | | | Two new macros are introduced so that users can use their customized timestamps for DLT messages: - DLT_LOG_TS(CONTEXT, LOGLEVEL, TS, ARGS ...) - DLT_LOG_ID_TS(CONTEXT, LOGLEVEL, MSGID, TS, ARGS ...) Detailed explanations can be found in dlt_for_developers.md. Also a new option is added to dlt-system to use events' timestamps from journald adapter. Signed-off-by: Sebastian Unger <sunger@de.adit-jv.com>
* dlt-daemon: correct errno usageVo Trung Chi2019-09-031-7/+9
| | | | | | | The errno must be saved in order to use with dlt_vlog() because the errno will be overwriten in dlt_vlog(). Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* dlt-daemon: fix bug binding invalid ipv6 address as defaultVo Trung Chi2019-09-031-2/+5
| | | | | | | The default INADDR_ANY is used ("0.0.0.0") as before. But it's invalid when DLT_USE_IPv6 flag ON. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* Add option in dlt.conf for bindAddress to specific IPs (#130)AdrianStoenescu2019-09-035-70/+155
| | | | | | | | | | | | | | | | | | | | | | | | Add the possibility to have in dlt.conf an option that specifies a set of IP addresses. The daemon will do a socket bind only for this list, therefore external connections will be limited to this set of IP addresses. If this option is not given, the default INADDR_ANY is used ("0.0.0.0") as before. The option in dlt.conf can look like this: BindAddress = 160.48.199.98;160.48.199.97;160.48.199.226,160.48.199.186;160.48.199.139;172.16.222.99 There can be as many addresses but only specified on one single line. They have to be delimited by ',' or ';'. ' ' (space) delimiter does not work. IPv6 addresses are supported as well. For instance: BindAddress = fe80::255:7bff:feb5:7df7 IPv6 addresses are acceptable only if DLT_USE_IPv6 flag is ON at compile time. IPv4 addresses are acceptable only if DLT_USE_IPv6 flag is OFF at compile time. One cannot have both IPv4 and IPv6 format in the same time. Signed-off-by: Adrian Stoenescu Adrian.Stoenescu@harman.com
* protocol: Remove non supported user service ID (#159)Saya Sugiura2019-09-022-14/+18
| | | | | | | | | | With this commit, following DLT user service IDs are now free to use: - 0xF0A - 0xF0F to 0xFFE Also the cases in dlt_daemon_client_process_control() is reordered so that it matches the order of dlt_user_services enum. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* libdlt: truncate the log message if it is too long (#156) (#157)Vo Trung Chi2019-09-021-90/+147
| | | | | | | | | | | | Change the behavior of dlt_user_log_write_string, dlt_user_log_write_constant_string and dlt_user_log_write_utf8_string so that they truncate the incoming message if it is too big and add "Message truncated, too long" at the end of it. These function should anyway still return an DLT_RETURN_USER_BUFFER_FULL error in this case. Signed-off-by: Nguyen Dinh Thi (RBVH/ENG2) <Thi.NguyenDinh@vn.bosch.com> Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
* UDP Multicast implementation (#155)Sunil-K-S2019-08-2311-3/+669
| | | | | The feature can be enabled by setting WITH_UDP_CONNECTION to ON. Signed-off-by: sunil.s <sunil.s@lge.com>
* daemon: fix compile error with DLT_IPC="UNIX_SOCKET" (#153)Vo Trung Chi2019-08-021-0/+2
| | | Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
* using POSIX shared memory APIs (#90) (#151)Vo Trung Chi2019-08-015-120/+299
| | | | | Replace all Linux specific shared memory APIs with POSIX alternatives. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* Revert "Add option in dlt.conf for bindAddress to specific IPs (#130)"Saya Sugiura2019-08-015-152/+70
| | | | This reverts commit e8716cc5c950e50411b23a7a6cafa3c063c59e90.
* Add option to set owner group of daemon FIFO (#122)Jiri Popek2019-07-253-3/+47
| | | | | | | | | | New option to set owner group of daemon FIFO (Default: /tmp/dlt) is added in dlt.conf. If this option is used properly, more secure tracing can be realized. Only application that is in dlt_user_apps_group can write log message to daemon FIFO. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* Add option in dlt.conf for bindAddress to specific IPs (#130)AdrianStoenescu2019-07-255-70/+152
| | | | | | | | | | | | | | | | | | | | | | | Add the possibility to have in dlt.conf an option that specifies a set of IP addresses. The daemon will do a socket bind only for this list, therefore external connections will be limited to this set of IP addresses. If this option is not given, the default INADDR_ANY is used ("0.0.0.0") as before. The option in dlt.conf can look like this: BindAddress = 160.48.199.98;160.48.199.97;160.48.199.226,160.48.199.186;160.48.199.139;172.16.222.99 There can be as many addresses but only specified on one single line. They have to be delimited by ',' or ';'. ' ' (space) delimiter does not work. IPv6 addresses are supported as well. For instance: BindAddress = fe80::255:7bff:feb5:7df7 IPv6 addresses are acceptable only if DLT_USE_IPv6 flag is ON at compile time. IPv4 addresses are acceptable only if DLT_USE_IPv6 flag is OFF at compile time. One cannot have both IPv4 and IPv6 format in the same time. Signed-off-by: Adrian Stoenescu Adrian.Stoenescu@harman.com
* dlt-system-journal: fixed localtime compile errorjiripopek2019-07-251-1/+1
| | | | | | | fixes compiler error "error: too many arguments to function ‘localtime’" Signed-off-by: jiripopek <Jiri.Popek@bmw.de>
* Correct sa findingsSaya Sugiura2019-07-248-45/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dlt_offline_logstorage.c - Parameter to isdigit is not correct - Handle the size of memset() and strncpy() properly dlt-test-stress-user.c - Parameter d is duplicated dlt_env_ll.c - Parameter env is used before NULL check - Remove redundant line dlt-control-common.c dlt_daemon_event_handler.c - Do not use NULL variable to print log dlt_config_file_parser.c - Remove unnecessary loop dlt_daemon_client.c - Return error in NULL check dlt_user.c - Free allocated memory in error case Related commit: 5c8f88d logstorage: fix compile error Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* logstorage: fix compile errorjiripopek2019-07-221-1/+1
| | | | | | Mount path unitialized and it is always NULL inside the statement. Signed-off-by: jiripopek <Jiri.Popek@bmw.de>
* doxygen: Align variable for apid and ctidSaya Sugiura2019-07-1911-144/+145
| | | | | | | The variables used for application id and context id are aligned with "apid" and "ctid". Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* doxygen: Remove licenceSaya Sugiura2019-07-19132-264/+0
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>