summaryrefslogtreecommitdiff
path: root/src/daemon
Commit message (Collapse)AuthorAgeFilesLines
* Code beautification using uncrustifyChristoph Lipka2018-12-2119-3510/+3025
| | | | Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* dlt-daemon: Output current number of connections as defaultYusuke Sato2018-12-211-15/+18
| | | | | | | | | | In previous, number of connections was output only if verbose mode in dlt.conf was enabled. This information is basically useful and is not output frequently. Therefore number of connections information is made to output as default when new connection is established or the connection is lost. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* Cleanup of unit test fixesManikandan C2018-12-212-14/+7
| | | | Signed-off-by: Manikandan C <mchockalingam@de.adit-jv.com>
* exit DLT daemon if /dev/null open fails during forkJeevan Ramakant Nagvekar2018-12-211-0/+5
| | | | | | | If /dev/null fails to open during DLT daemon's fork handling, it is treated as an error and DLT daemon exits. Signed-off-by: Jeevan Ramakant Nagvekar <jeevan.nagvekar1@wipro.com>
* Improvement - use dup2 in place of dup in daemon forkJeevan Ramakant Nagvekar2018-12-211-16/+19
| | | | | | | | | | | 1> While daemonizing DLT, for connecting I/O file descriptors to /dev/NULL POSIX call dup() is used. dup2() POSIX call is now used where explicit standard I/O descriptor number is mentioned. 2>After fork() directory changed to root in place of FIFO Base directory - "/tmp" Signed-off-by: Jeevan Ramakant Nagvekar <jeevan.nagvekar1@wipro.com>
* Remove one-instance-lock mechanismJeevan Ramakant Nagvekar2018-12-212-36/+1
| | | | | | | | | | | | | | This commit removes DLT's "one-instance-lock" mechanism. In daemonized mode, on first instance, a file is created (if not already created) and locked. If second instance is attempted file locking fails since the file is already locked by first instance. This prevents new instance of the DLT daemon. After analysis its found that there is no need of any mechanism for prevention of another instance. The same is already taken care by socket mechanism. Since main socket is created by first instance, attempt to create it again with same port number fails. Signed-off-by: Jeevan Ramakant Nagvekar <jeevan.nagvekar1@wipro.com>
* daemon: Add exit triggerSaya Sugiura2018-12-212-13/+19
| | | | | Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* UnitTest: UpdatesManikandanC2018-12-2111-21/+114
| | | | | | | | | | | | Gateway Logstorage Event Handler Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com> Signed-off-by: Aditya Paluri <venkataaditya.paluri@in.bosch.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Made socket send reliableManikandan C2018-12-214-48/+81
| | | | | | | | Made TCP socket send reliable by storing the unsent/partial message in the ring buffer. This will avoid the corrupted messages/Gaps in Viewer side Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Removed log level change callback notification while context register done ↵Ravi Sankar P2018-12-211-6/+10
| | | | | | with ll_ts API Signed-off-by: Ravi Sankar P <ponnurangamravi.sankar@in.bosch.com>
* Fixed compiler error with previous commitManikandan C2018-12-121-1/+1
| | | | Signed-off-by: Manikandan C <mchockalingam@de.adit-jv.com>
* Dynamic allocation of msg bufferManikandanC2018-12-103-10/+27
| | | | | | | | | | | | | It is possible to change the default buffer size for log message creation via environment variable: export DLT_LOG_MSG_BUF_LEN=<value> Instead of using a static buffer with size of 1390 bytes, the buffer is allocated dynamically with the specified value.The max size is restricted to approx 65k. Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* rename #define STATIC to DLT_STATICManikandan C2018-12-063-16/+16
| | | | Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Use poll in the dlt-daemon for POSIX complianceManikandanC2018-11-307-112/+201
| | | | | | | | | | | The poll system call is now used in the daemon to enable DLT use in POSIX compliant systems. Also added introduced new unregister_app macro to avoid missing of logs in startup buffer. Signed-off-by: Frederic Berat <fberat@de.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
* dlt-client: logging: Extended the receiver buffer sizeManikandan C2018-11-231-1/+0
| | | | | | | | | | | - dlt-control couldn't receive all the GET_LOG_INFO response message when many applications and contexts are registered. Therefore the receiver buffer size was extended to 65K. Also the receive buffer size macros are reduced to one variable. - Code cleanup and improvements Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Protocol: DLT Service ID Enum instead of definesManikandan C2018-11-231-1/+1
| | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Gateway ImprovementsManikandan C2018-11-233-24/+45
| | | | | | | | | | | | | -Support to send and parse periodic control messages -add application/contexts to passive ECU list -Refactor dlt_gateway_send_control_message -Gateway issues with corrupted data and on demand connection -Unit Test update Signed-off-by: Saya Sugiura ssugiura@jp.adit-jv.com Signed-off-by: Christoph Lipka clipka@jp.adit-jv.com Signed-off-by: S. Hameed shameed@jp.adit-jv.com Signed-off-by: ManikandanC Manikandan.Chockalingam@in.bosch.com
* Log storage - Updates (#82)ManikandanChockalingam2018-11-155-364/+1071
| | | | | | | | | | - improvements and refactor key creation - Sync strategies added Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com> Signed-off-by: Ravi Sankar P <ponnurangamravi.sankar@in.bosch.com> Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* dlt-daemon: per ECU list of user information (#80)ManikandanChockalingam2018-10-305-342/+881
| | | | | | Prepare daemon to store applications/context information of other ECUs as well. This commit prepares the dlt-daemon to store logs from passive nodes in a logstorage device. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Fix compiler warning PR #77Christoph Lipka2018-09-253-3/+3
| | | | | | warning: extra tokens at end of #ifdef directive Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* Fix compilation with glibc 2.28 (#77)Oleksndr Kravchuk2018-09-253-3/+3
| | | | | | | | Package compilation fails with GLIBC 2.28: stat.h:56:8: error: redefinition of 'struct statx_timestamp' stat.h:99:8: error: redefinition of 'struct statx' Signed-off-by: Oleksandr Kravchuk <oleksandr.kravchuk@pelagicore.com>
* dlt-daemon: fixed linked-list element remove (#71)Konstantyn2018-08-241-7/+15
|
* dlt-daemon: Fix no state transition to BUFFER state (#65)Yusuke Sato2018-08-231-3/+15
| | | | | | | When epoll detected error for TCP client connection, no state transition had been happened. (Only the file descriptor had been closed) To prevent this, dedicated close function is called according to connection type. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* dlt-daemon: Output signal number at exit (#68)Yusuke Sato2018-05-291-7/+8
| | | | | | | | | | | So far, signal number had been output in signal handler. However this was not so safety. And when syslog was used as log output destination of dlt_log(), we could not see any info in the same Life Cycle. So dlt_log() is removed from signal handler and signal number is newly output by DLT message and dlt_log() at exit. This info will help analysis why dlt-daemon exits. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* dlt-daemon: Improve error logging on accept() failure (#69)Yusuke Sato2018-05-281-3/+3
| | | | | | | | | Error log in case of accept() failure is improved with errno info. This helps us to analyze dlt-daemon's issue in future. (e.g.) Connection request come to wrong socket unexpectedly and this causes exiting dlt-daemon. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* dlt-daemon: Avoid to output duplicated application registration message (#63)Yusuke Sato2018-05-232-12/+22
| | | | | | | | | | | | | | | | If application tries to send application registration request before dlt-daemon startup, the request is sent twice as below: 1. Buffered request in user library buffer 2. New request when user app succeeds to attach to dlt-daemon In previous, dlt-daemon had been output the registration messages 2 times even though these messages were come from same application. This duplicated output is avoided by this change. Warning message in case of dlt-runtime-context.cfg exists is also avoided. This file is created when Control message: "Store Config" is used. This is not irregular case. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* dlt-daemon: Not output Context un-/registration DLT message by default (#62)Yusuke Sato2018-05-231-5/+11
| | | | | | | | | | | This patch changes Context un-/registration message not to output DLT by default for the purpose of reducing trace messages. Actually dlt-daemon already sends almost same meaning control message which can show Context un-/registration([get_log_info] and [unregister_context]). These are duplicate message and should be suppressed in normal case. Only if "Verbose = 1" is set in dlt.conf, the messages are output as same as before. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* dlt-daemon: Continue to send log level / connection status even if error ↵Yusuke Sato2018-05-231-3/+3
| | | | | | | | | | | | | | | | | | occurs (#61) In previous, there was possibility that application could not get notification from dlt-daemon due to wrong error handling. (e.g.) 1. App1, App2 and App3 register App/Context 2. App2 crashes without unregistering App/Context 3. Change default log level from DLT Viewer --> App1 can receive new default log level from dlt-daemon but App3 cannot. This patch makes processing non-stop even if error occurs in below cases: - While updating log level of all registered apps - While updating default log level/ default trace status - While updating connection status between dlt-daemon and dlt-client Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* IPC: Unix socket added (#43)ManikandanChockalingam2018-05-1810-82/+272
| | | | | | | | | * IPC: Unix socket added The user can select either FIFO or UNIX socket as IPC between user library and daemon through CMakelist option. Socket path configurable for both FIFO and Unix Socket now configurable in CMake Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Introduce controlling entire system trace status feature from dlt-control (#57)Yusuke Sato2018-05-184-43/+244
| | | | | | | | | | | | | | | | | | | | | * dlt-control: Provision to control entire system trace status 1. support for setting trace status using wildcards for both app and context 2. support for setting entire system trace status *This Logic is as same as for changing log level. (SHA: a966393ad7003d02870bceffa08df5ddf4bbf864 dlt-control: Provision to control entire system log level) * dlt-daemon: Fix control entire log level / trace status issue In previous, dlt-control could send request to set all log level / trace status with DLT_LOG_DEFAULT / DLT_TRACE_STATUS_DEFAULT(-1). However, dlt-daemon could not accept these value. This change fix this issue so that setting log level/trace status of all registered contexts become possible. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* dlt-daemon: Lower log level of logs not to output unintentional warning (#58)Yusuke Sato2018-05-181-8/+5
| | | | | | | | | | | | | * dlt-daemon: Lower log level of several logs not to output unintentional warning Change log level of several logs from WARNING to INFO. 1. User FIFO cannot be opened because the FIFO does not exist --> This case can happen if DLT user app is one-shot 2. Runtime configuration file (dlt-runtime-application.cfg / dlt-runtime-context.cfg) cannot be opened --> This case can happen in normal use case. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* dlt-daemon: Fix infinite loop on set log level using wildcards (#55)Yusuke Sato2018-05-081-1/+1
| | | | | | dlt-daemon entered to infinite loop when set log level request with wildcards came from dlt-control due to variable size. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* dlt-daemon: Fix repeated output of marker message (#54)Yusuke Sato2018-05-081-1/+4
| | | | | | | | Marker message had been continued to output if application called dlt_log_marker() due to missing byte removing processing against marker message. Therefore the byte removing for marker message processing is added. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* Fix ForceContextLogLevelAndTraceStatus handling in dlt_daemon_client.c (#50)kundatipradeep2018-04-271-4/+33
| | | | | Even Forcing log level and trace status of context to not exceed "ContextLogLevel" and "ContextTraceStatus" in dlt.conf file with ForceContextLogLevelAndTraceStatus = 1, the default log level is being overwritten with high value than expected by client(DLT_Viewer when default trace data request is sent ) and by dlt-control application on usage of (dlt-control -d loglevel IP_ADDRESS) With provided patch/changes in place, when ForceContextLogLevelAndTraceStatus is enabled the requested log level is checked with ContextLogLevel and if it satisfied the daemon default loglevel gets updated. Added a conditional checks to not to overwrite the individual contextLoglevel and ContextTracesStatus when ForceContextLogLevelAndTraceStatus is enabled in dlt.conf file and taken care of review comments.
* minor compiler warning gcc 7.x (#30)Phong Tran2018-03-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix -Wpointer-compare of compare with null char Signed-off-by: Phong Tran <tranmanphong@gmail.com> * dlt_common: fix -Wformat-truncation of snprintf Avoid snprintf output truncation by handling return value Signed-off-by: Phong Tran <tranmanphong@gmail.com> * dlt_offline_trace: Fix Wformat-truncation of snprintf Compile with Gcc 7.x has the warning of snprintf buffer length size. Check return value of snprintf() for avoiding the warning. Signed-off-by: Phong Tran <tranmanphong@gmail.com> * dlt_common_test: Fix memleak t_dlt_message_read some resources were not free after using. Detected by running valgrind --leak-check=full ./gtest_dlt_common Signed-off-by: Phong Tran <tranmanphong@gmail.com>
* improve error reporting in dlt_daemon_socket (#41)Florian Castellane2018-02-141-14/+17
| | | | | | * improve error reporting in dlt_daemon_socket * use dlt_vlog
* fix PR #26 socket_sendreliable data_send updateChristoph Lipka2018-01-191-1/+5
| | | | | | do not update data_send in case of temporal error Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* Prevention for occasional corrupted messages (#26)baduras2018-01-123-21/+56
| | | Prevention for occasional corrupted messages caused mostly due to system high load.
* Minor fixes: corrected typo in CMakeLists.txt - WTIH_DLT_ADAPTOR, removed ↵Stefan Badura2017-08-301-1/+1
| | | | character from merge - +
* Data stuck in receiver buffer when dlt_daemon_user_send_log_level() fails (#21)Lutz Helwing2017-08-222-10/+21
| | | | | | | | | | | | - When dlt_daemon_user_send_log_level() called in dlt_daemon_process_user_message_register_context() fails -1 was returned which caused dlt_daemon_process_user_messages() to stop processing receiver buffer. Remaining data was stuck until new data arrived over FIFO. - Make debug output of dlt_daemon_user_send_log_level() more verbose. Signed-off-by: Lutz Helwing <lutz_helwing@mentor.com>
* cmake: fix unit tests compilation with systemd (#17)Gordan Markuš2017-06-161-1/+1
| | | | | | | | | By enabling the WITH_SYSTEMD and WITH_DLT_UNIT_TESTS cmake flags the build will fail with an error due to a linking issue: ../src/daemon/libdlt_daemon.so: undefined reference to `sd_booted' collect2: error: ld returned 1 exit status Signed-off-by: Gordan Markuš <gordan.markus@pelagicore.com>
* dlt_daemon_connection_types: fix build warnings (#14)Gordan Markuš2017-05-181-1/+1
| | | | | | | | | | | | dlt-daemon/src/daemon/dlt_daemon_event_handler.c: In function ‘dlt_daemon_handle_event’: dlt-daemon/src/daemon/dlt_daemon_event_handler.c:131:30: waring: cast from pointer to integer of different size [-Wpointer-to-int-cast] DltConnectionId id = (DltConnectionId)ev->data.ptr; ^ dlt-daemon/src/daemon/dlt_daemon_event_handler.c: In function ‘dlt_connection_check_activate’: dlt-daemon/src/daemon/dlt_daemon_event_handler.c:381:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] ev.data.ptr = (void *)con->id; ^ Signed-off-by: Gordan Markuš <gordan.markus@pelagicore.com>
* dlt-daemon: Fix use after free potential issueFrederic Berat2017-02-015-3/+48
| | | | | | | | | | | | | In dlt_daemon_send_all_multiple, if the connection was broken, we closed it before getting the next available connection. This must be avoided by having a temporary next pointer. The same kind of problem is valid for pointers coming from the epoll interface. The kernel can provide back connection pointer that are not valid any longer. Therefore, we need to use an ID instead of the pointer value to retrieve the connections. Signed-off-by: Frederic Berat <fberat@de.adit-jv.com> Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Event handling: Fix connection destroy bugChristoph Lipka2017-02-012-0/+8
| | | | | | | | | It might happen that an event is part of the epoll event queue that belongs to a connection which was destroyed before the event is handled. Due to this, the event handling main loop might stop and the daemon exits. This misbehavior is fixed with this patch. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* daemon: check payload length before cast to structChristoph Lipka2017-01-311-15/+66
| | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Unit Test: Event handlingChristoph Lipka2016-10-244-6/+43
| | | | | | Unit tests for DLT Daemon connection and event handling Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Unit Test: MultiNodeOnkar Palkar2016-10-241-0/+10
| | | | | | Unit test for DLT MultiNode extension Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* MultiNode: Specify config file location in dlt.confChristoph Lipka2016-10-243-3/+24
| | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* process user message: Fix bound handlingFrederic Berat2016-10-241-16/+99
| | | | | | | | | | | | | | | | | | | | | | | | On context and application registration, the data needs to be read in 2 parts. If the first part was at the end of the receiver buffer, it was wrongly removed whereas the complete data is not full received and therefore interpretable. This has to be fixed by not removing the data before everything is checked. Thus, while readjusting the buffer to the first found header, the offset was not properly updated. Signed-off-by: Frederic Berat <fberat@de.adit-jv.com> Process User Messages: Fix buffer handling In case application and context registration the buffer need to be read two times. But before removing the data, the data need to be readjusted to its origin. This was missing in a previous fix. Furthermore, in case of corrupted description field, applications and contexts will be registered anyway with the dummy description "Unknown". Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Fix: dlt-daemon overwrites ECU ID even if user log message already has the ↵Yusuke Sato2016-09-231-2/+2
| | | | | | | | | | | ECU ID that is not default value dlt-daemon overwrites ECU ID even if user log message already has the ECU ID that is not default value. This phenomenon happens when application uses dlt_forward_msg(). Therefore, dlt-daemon is modified not to overwrite ECU ID if log message has already has the ECU ID. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp> Change-Id: Icbc6304e5571242bf75ff0d32cbe4b004f1d7f9d