summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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-181-0/+16
| | | | 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>
* sys/poll.h: deprecate old sys/poll.h include header, now glibc/musl wants ↵Gianfranco Costamagna2020-01-275-5/+5
| | | | | | | | | poll.h being included directly. This fixes a build failure on musl systems with strict c hardening flags Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
* dlt-test-init-free: fix build failure with strict compiler flags, due to ↵Gianfranco Costamagna2020-01-271-2/+2
| | | | | | | | | uint being undefined. This is actually an "int" type, looking at the test implementation Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
* dlt.conf: suppress the warnings udp multicast (#197)Phong Tran2019-12-111-3/+3
| | | | | | | | | | | | | There are some warnings while running dlt-daemon: $dlt-daemon Unknown option: UDPConnectionSetup=1 Unknown option: UDPMulticastIPAddress=225.0.0.37 Unknown option: UDPMulticastIPPort=3491 cause the WITH_UDP_CONNECTION is not enabled by default (c9d1ba4b). The configuration for this feature should be sync. Signed-off-by: Phong Tran <tranmanphong@gmail.com>
* dlt_daemon_socket: leave while socket binds failsPhong Tran2019-12-111-0/+1
| | | | | | | CID 351398 (#1 of 1): Use after close (USE_AFTER_FREE) 8. pass_closed_arg: Passing closed handle *sock as an argument to dlt_daemon_socket_get_send_qeue_max_size Signed-off-by: Phong Tran <tranmanphong@gmail.com>
* dlt_user: init DltContextData before usePhong Tran2019-12-111-5/+4
| | | | | | | | for fixing the coverity warnings type Uninitialized scalar variable (UNINIT). Using uninitialized value log.use_timestamp when calling dlt_user_log_send_log. Signed-off-by: Phong Tran <tranmanphong@gmail.com>
* 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>