summaryrefslogtreecommitdiff
path: root/src/lib
Commit message (Collapse)AuthorAgeFilesLines
* libdlt: Do not allow DLT usage in forked child (#95)Simon Herkenhoff2019-02-041-36/+58
| | | | | | | | | | | | | DLT shall not be used in a forked child until a variant of exec() is called, because DLT is using non async-signal-safe functions. The forking process can continue to use libdlt's logging facilities, but any attempt to use libdlt from the forked child will be denied. The fork-handler test is updated to reflect this by trying to log from the forked child which will fail. The fork then calls exec and runs another application that can continue to use DLT. Signed-off-by: Simon Herkenhoff <sherkenhoff@jp.adit-jv.com>
* Code beautification using uncrustifyChristoph Lipka2018-12-216-2694/+2162
| | | | Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* Cleanup of unit test fixesManikandan C2018-12-212-25/+25
| | | | Signed-off-by: Manikandan C <mchockalingam@de.adit-jv.com>
* libdlt: Add error handlingSaya Sugiura2018-12-211-70/+126
| | | | | | | Error handling was added in case it failed to send to daemon. Signed-off-by: S. Hameed <shameed@jp.adit-jv.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* UnitTest: UpdatesManikandanC2018-12-213-41/+59
| | | | | | | | | | | | 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>
* lib: socket: Flush all data before closing socketSaya Sugiura2018-12-212-3/+40
| | | | | | | | | | | | | | Sometimes socket will be closed even not all of the data is flushed to daemon. So before closing, following will be handled: 1. Use shutdown() to shut down further transmissions 2. Subsequent read() to resend_buffer Also socket fd is reset in child fork handler since the socket itself will not be duplicated in the child process. Solves JIRA: SWGIII-28702 Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Removed log level change callback notification while context register done ↵Ravi Sankar P2018-12-211-2/+2
| | | | | | with ll_ts API Signed-off-by: Ravi Sankar P <ponnurangamravi.sankar@in.bosch.com>
* Logging: avoided missing of log level change callback Added new context ↵Manikandan C2018-12-211-146/+205
| | | | | | registration Macro and API which has option to register log level change callback along with it. This will avoid missing of initial log level change callback when daemon sends the log level change control msg during context registration Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Injection: New callback with private data Added new injection callback with ↵ManikandanC2018-12-211-18/+66
| | | | | | private data as argument Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Dynamic allocation of msg bufferManikandanC2018-12-103-180/+292
| | | | | | | | | | | | | 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-061-1/+1
| | | | Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Use poll in the dlt-daemon for POSIX complianceManikandanC2018-11-302-10/+53
| | | | | | | | | | | 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-232-6/+3
| | | | | | | | | | | - 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-231-37/+342
| | | | | | | | | | | | | -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
* dlt-daemon: per ECU list of user information (#80)ManikandanChockalingam2018-10-301-2/+2
| | | | | | 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>
* Update dlt_user.c (#66)kundatipradeep2018-08-241-0/+13
| | | | In dlt_user_log_send_log and dlt_forward_msg API's when writing the data to DLT PIPE is not successful in scenario which returns "DLT_RETURN_PIPE_ERROR"(Non availability of dlt pipe post termination of DLT DAEMON) it ideally starts stores the data in internal buffer, and close the dlt user handle, which is quiet appropriate. The scenario were dlt application fails in writing data to dlt pipe returns DLT_RETURN_PIPE_ERROR and case were application buffer is full, the return value DLT_RETURN_PIPE_ERROR is over written to "DLT_RETURN_BUFFER_FULL" were dlt user handle will not be reset to -1, it till holds the former data which causes undefined behavior of dlt application(One behavior would be which calls dlt_user_queue_resend and internally allocates memory for segmented data and tries to free it at dlt_user_trace_network_segmented_thread which is not intended behavior, instead return silently when FIFO is not available)
* libdlt: Avoid busy loop in error case of mq_receive() (#59)Yusuke Sato2018-05-292-1/+16
| | | | | | | To avoid busy loop due to error of mq_receive() which is called in sub thread, 100ms sleep is added for the error case. Error log message for mq_receive() is also corrected to have errno. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* IPC: Unix socket added (#43)ManikandanChockalingam2018-05-181-113/+208
| | | | | | | | | * 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-181-0/+37
| | | | | | | | | | | | | | | | | | | | | * 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>
* minor compiler warning gcc 7.x (#30)Phong Tran2018-03-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix for initialization of buffer settings in DLT user library. (#25)baduras2017-09-131-2/+2
|
* Merge pull request #7 from clipka/devel_dlt_client_cleanup_fixRalphNiemeyer2017-03-231-0/+32
|\ | | | | dlt-client: fix dlt_client_cleanup memory handling
| * dlt-client: fix dlt_client_cleanup memory handlingOnkar Palkar2017-02-061-0/+32
| | | | | | | | | | | | | | Setter function introduced for seting up string parameters which are free'd in dlt_client_cleanup Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* | CMake Option: Trigger segmentation fault in case of FATAL logChristoph Lipka2017-02-021-0/+14
|/ | | | | | | | When the user library receives a log with log level DLT_LOG_FATAL it triggers a segmentation fault to provide information to the developer via tools like coredump. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Environment variables for library ringbufferChristoph Lipka2016-10-242-1/+56
| | | | | | | | | | | | This patch adds environment variables to configure user library ringbuffer and step size. The following variables can be set: DLT_USER_BUFFER_MIN - for minimal size DLT_USER_BUFFER_MAX - for maximal size DLT_USER_BUFFER_STEP - for step size Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* DLT_PTR macro: Improve implementation and function API addedChristoph Lipka2016-10-241-0/+32
| | | | | | | | The original implementation result in a compile error when DLT_PTR is used with other macros like DLT_STRING. This patch overcomes that problem. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* dlt-client: Use correct port on connectChristoph Lipka2016-10-241-23/+31
| | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Fix: Memory for context description is not freedYusuke Sato2016-09-231-0/+18
| | | | | | | | Currently, allocated memory for context description is not freed in dlt_free(). free() for each member variables of dlt_user.dlt_ll_ts[i] is added in the for block in dlt_free(). Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp> Change-Id: I52a81cf2918cb0014fdcfc666cb8bb93ca7cb525
* Fix: Handle of /tmp/dlt never reset if dlt-daemon is killed during output ↵Yusuke Sato2016-09-231-1/+1
| | | | | | | | | | user buffer Handle of /tmp/dlt cannot be reset if dlt-daemon is killed during output user buffer because dlt_user_log_resend_buffer() never returns DLT_RETURN_PIPE_ERROR. Return value of dlt_user_log_resend_buffer() is modified to pass return value of dlt_user_log_out3() without change. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp> Change-Id: I506103ebebcdb3c145d1f0719a3c8caffc8d89c1
* Fix: Segfault in checking buffer usageYusuke Sato2016-09-231-0/+3
| | | | | | | | Segfault is caused by dlt_user_check_buffer() if this function is called during increasing the user buffer. To avoid this issue, semaphore has to be added. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp> Change-Id: Ie56f2fb73aeacb835180468e57c9338d2ffdb072
* Fix: File name is broken when file is transferred on 64 bit OS.Yusuke Sato2016-09-231-18/+18
| | | | | | | | When file transfer feature of dlt-system is used on the 64 bit OS, file name is overwritten at the unique name creation phase. File serial number should be maximum 10-digit decimal number. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp> Change-Id: I18fac363a103b6806ed9eb003ebbb305af7e7f58
* Add dlt_user_is_logLevel_enabled APIChristoph Lipka2016-09-231-1/+1
| | | | | | | | | | This function allows an application developer to check if the DLT LogLevel is enabled before starting any log string creation. It can be used in application specific logging wrapper functions. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Change-Id: I4c269b12bfdeae29a4e795385cdbc54a579ba621
* Fixed D-Bus tracing not working anymoreAlexander Wenzel2016-05-131-1/+1
| | | | | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> Topic: GENDLT-425 Change-Id: I4ec56d714804d9ee4fa904b71c58dafd00990b4f
* Fixed not working default log level.Alexander Wenzel2016-05-031-8/+12
| | | | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> Change-Id: Id01c9a11e4b5ccf4166f10c5e45363f3a7c00535
* Fixed not returning the correct number of lost messages at exit.Alexander Wenzel2016-05-031-1/+5
| | | | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> Change-Id: I211222d04350820098bf56dfc5b7aee50e2529f0
* CommonControl: Unix socket path and ecuid parsing for control applicationsManikandan C2016-04-281-1/+1
| | | | | | Signed-off-by: Manikandan C <Manikandan.Chockalingam@in.bosch.com> Change-Id: I023c6bccbe3977d50b77bb601df80643d8e2d82c
* dlt-control: Provision to control entire system log levelManikandan C2016-04-281-1/+31
| | | | | | | | 1. support for setting log level using wildcards for both app and context 2. support for setting entire system log level Signed-off-by: Manikandan C <Manikandan.Chockalingam@in.bosch.com> Change-Id: I92f8c5461903f092cd50f05f644013432940a87b
* MultiNode: Add support for port configurationFrederic Berat2016-04-271-10/+35
| | | | | | Signed-off-by:Frederic Berat <fberat@de.adit-jv.com> Change-Id: I9b387d5713f5ae7b6fcfadb22d804fdb97534e44
* DLT_RETURN_USER_BUFFER_FULL is returned when user buffer fullLutz Helwing2016-04-221-113/+59
| | | | | | | | | A new return value DLT_RETURN_USER_BUFFER_FULL is introduced which is returned by all dlt_user_log_write_* and dlt_log_* functions when the data to be added to the user buffer exceeds its size (datasize > DLT_USER_BUF_MAX_SIZE) Signed-off-by: Lutz Helwing <lutz_helwing@mentor.com>
* Revert truncation of string or raw blockLutz Helwing2016-04-221-26/+16
| | | | | | | | | | | | | | | Commit d319ebf4d2d449d70befae0eebbdd82c19c5315f introduced new handling of the situation when writing data to the user buffer would exceed its size. This was achieved by truncating the data to fit. This solution had a problem: It could lead to a buffer overflow when the updated arg_size gets negative (actually undefined value because it is unsigned). As a quick fix the behaviour is reverted to the state before the aforementioned commit. Signed-off-by: Lutz Helwing <lutz_helwing@mentor.com>
* Fix bug with truncation of string or raw blockLutz Helwing2016-02-251-46/+33
| | | | | | | | With commit d319ebf4d2d449d70befae0eebbdd82c19c5315f a bug was introduces which lead to some messages getting not transmitted. Change-Id: I9f20177fbc7db9d7caf527e14159444b5fec168a Signed-off-by: Lutz Helwing <lutz_helwing@mentor.com>
* Truncate of string or raw block, if length exceeds maximum message lengthLutz Helwing2016-02-191-46/+65
| | | | | | | | | | | | | Previously if messages containing strings or raw data were exceeding the maximum message size (DLT_USER_BUF_MAX_SIZE, currently set to 1390) they were discarded completely. This behaviour is changed so that too large data is truncated and sent anyway. Commented out part of unit test for dlt_log_raw abnormal where negative values for unsigned length were passed. Change-Id: I4f6bf152e7125924717c941ad7ebb8fd79787715 Signed-off-by: Lutz Helwing <lutz_helwing@mentor.com>
* Fix fork()-handler in libdltStefan Vacek2015-12-091-7/+21
| | | | Signed-off-by: Stefan Vacek <stefan.vacek@intel.com>
* Set default log-levels in dlt.confStefan Vacek2015-12-091-1/+3
| | | | | | | | - feature: allow to define a default-log-level in dlt.conf (see dlt.conf for documentation) - bugfix: make dlt_unlock_mutex not inline to fix linkage - bugfix: initial log-level was not set correctly when no dlt-daemon was running Signed-off-by: Stefan Vacek <stefan.vacek@intel.com>
* Fix register context before application is registeredStefan Vacek2015-12-081-10/+1
| | | | | | | | Additional: - include sd-daemon.h if watchdog is enabled - fix formatting for printf 64bit values Signed-off-by: Stefan Vacek <stefan.vacek@intel.com>
* Unix socket control interfaceChristoph Lipka2015-11-241-7/+43
| | | | | | | | | | | | | | | | Control applications running in the same Linux OS should be able to communicate with the DLT Daemon via a socket connection. To be able to do that, the DLT Client library need to be extended. DLT Clients connected via this UNIX socket are not handled as normal DLT Clients and no log messages will be forwarded to them. This avoids problems in situations when a control application is connected to the DLT Daemon before any other 'real' DLT Client (e.g. DLT Viewer) is connected. In this situations, all already stored log messages are flushed to the control application and therefore lost, because the control application most likely ignore all incoming messages besides the one in which it is interested in. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* GetLogInfo: supported get log info in dlt-controlManikandan C2015-11-181-0/+43
| | | | | | | added option to get log info in dlt-control app. The response parameter is parsed and the details are printed back to the console Signed-off-by: Manikandan C <Manikandan.Chockalingam@in.bosch.com>
* Got rid of warnings from some older compilersLutz Helwing2015-10-281-5/+10
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* DLT daemon improvement - dlt_init()-checkLutz Helwing2015-10-074-1717/+1777
| | | | | | | | | | DLT daemon improvement - parameter value range check Adapt unit tests to check for enum return values Changed C version to gnu99 and C++ version to gnu++0c Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>