summaryrefslogtreecommitdiff
path: root/src/daemon/dlt_daemon_common.c
Commit message (Collapse)AuthorAgeFilesLines
* Dynamic allocation of msg bufferManikandanC2018-12-101-2/+5
| | | | | | | | | | | | | 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>
* Log storage - Updates (#82)ManikandanChockalingam2018-11-151-6/+2
| | | | | | | | | | - 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-301-223/+587
| | | | | | 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>
* dlt-daemon: Avoid to output duplicated application registration message (#63)Yusuke Sato2018-05-231-1/+1
| | | | | | | | | | | | | | | | 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: 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-181-9/+26
| | | | | | | | | * 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-1/+32
| | | | | | | | | | | | | | | | | | | | | * 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>
* 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>
* Data stuck in receiver buffer when dlt_daemon_user_send_log_level() fails (#21)Lutz Helwing2017-08-221-5/+20
| | | | | | | | | | | | - 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>
* dlt-control: Provision to control entire system log levelManikandan C2016-04-281-0/+29
| | | | | | | | 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
* Set default log-levels in dlt.confStefan Vacek2015-12-091-6/+26
| | | | | | | | - 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>
* DLT daemon improvement - dlt_init()-checkLutz Helwing2015-10-071-325/+311
| | | | | | | | | | 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>
* Allow multiple instances of dlt-daemonStefan Vacek2015-10-071-2/+2
| | | | | | | | | | | | | | | | - Make dlt-daemon configurable to specify directory of fifos and port of dlt-daemon, this allows to run multiple instances of dlt-daemon at one node at the same time. This is useful in testing environment where simultanous tests should not interfere due to the same instance of dlt-daemon - dlt-daemon: add option -t <dir> to specify a directory where all fifos will be created - dlt-daemon: add option -p <port> to specify the port under which dlt-daemon can be connected - client-library: add environment variable DLT_PIPE_DIR to specify a non-default directory of fifos for logging applications - client-library: add environment variable DLT_DAEMON_TCP_PORT to specify the port under which dlt-daemon can be reached (especially when using dlt-receive) Signed-off-by: Stefan Vacek <stefan.vacek@intel.com> Signed-off-by: Lutz Helwing <lutz_helwing@mentor.com>
* Offline Logstorage [1/4]: DLT preparation to enable offline logstorageS. Hameed2015-07-301-1/+9
| | | | Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
* Removed all trailing whitespacesLutz Helwing2015-07-211-7/+7
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Fixed license headers and copyright doxygen commentsLutz Helwing2015-06-171-2/+2
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Updated license headers to latest GENIVI license policy. Fixed further LRT ↵Lutz Helwing2015-06-171-11/+15
| | | | | | Scan findings. Renamed and cleanup further files. Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Change daemon state handling to have all traces in online trace even when ↵Sascha Philipp2015-03-251-2/+2
| | | | | | | offline trace is active Change-Id: Ic212c4956582b18e05739d593bf5c792d60d9c00 Signed-off-by: Sascha Philipp <sascha.philipp@continental-corporation.com>
* Reworked internal outputSascha Philipp2015-03-251-12/+12
| | | | | | Change-Id: I371c1b234929fda46608f563f08cae141b97d0a9 Signed-off-by: Ralf Anton Beier <ralf.anton.beier@continental-corporation.com> Signed-off-by: Sascha Philipp <sascha.philipp@continental-corporation.com>
* Make daemon buffer size configurableAlexander Wenzel2014-05-161-2/+4
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Fixed: all possible malloc, sprintf and strcpy problemsAlexander Wenzel2014-04-011-15/+35
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Cleanup of send return values. Further cleanup of send restructure.Alexander Wenzel2014-01-101-3/+4
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Centralised send function to client. Introduced connection state to dlt daemon.Alexander Wenzel2014-01-101-1497/+29
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Added new control message timezone.Alexander Wenzel2014-01-101-1/+59
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Fixed possible crash when runtime configurations files are corrupted.Alexander Wenzel2014-01-101-22/+50
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Close socket when send fails.Alexander Wenzel2014-01-101-3/+3
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Added conntection info and unregister context control messages.Alexander Wenzel2014-01-101-0/+117
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Bug 44 - Don't print "Buffer full" message from DLT daemon for each trace.Alexander Wenzel2013-08-071-14/+23
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* some coverity fixesSimon Brandner2013-07-191-3/+9
| | | | | | fixed some merge problems Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Semaphores and Pointer passing insteasd by value and otehr coverity issue fixesSimon Brandner2013-07-191-3/+10
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Regression fix: check ferror/feof when fgets return NULLLassi Marttala2013-07-191-4/+38
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Unify ECU version sending functionsLassi Marttala2013-07-191-56/+2
| | | | | | | | | | Review changes: Lower log level when opening fails. It might be deliberately set to non-existent file. Give name to period time in ECU version sending Merge branch 'LM-GSWD-162' Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* fixed possible overflow in dlt-system-filetransfer and missing fclose in ↵Simon Brandner2013-07-191-0/+1
| | | | | | dlt_daemon_common Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* appended null termination to version stringSimon Brandner2013-07-191-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | adding closure of socket in syslog_thread and read_socket fixed missing free of filepath in compressed file transfer fixed missing closedir in added in send_one error case fixed missing fclose of src_file in ferror case dlt-daemon.c fixed missing fclose in ferror case dlt_common.c using snprintf for filename instead sprintf in dlt_file_open modified some magix numbers - replaced by limits.h values. added strncpy instead strcpy to make cp more safe. split up a function to avoid coverity complaint when computing size of a write buffer length dlt_daemon_common: added strncpy instead strcpy to make cp more safe. Fixes some more Coverity issues in dlt-daemon.c dlt_user.c dlt_common.c and dlt_offline_trace.c. Conflicts: src/daemon/dlt-daemon.c src/lib/dlt_user.c Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Removed most warnings caused by: Wunused-but-set-variable flag. Eome were ↵Simon Brandner2013-07-191-2/+41
| | | | | | kept, because they were the nicer variant to eliminate them, or they seemed reserved for an commandline argument Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Create new fifo only when same application registers with different pid.Alexander Wenzel2012-11-261-1/+1
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* [GDLT-24]: Fix for a compiler warning.Lassi Marttala2012-06-131-1/+2
| | | | Signed-off-by: Christian Muck <christian.muck@bmw.de>
* [GDLT-94]: Send periodic software version messages.Lassi Marttala2012-06-131-1/+52
| | | | Signed-off-by: Christian Muck <christian.muck@bmw.de>
* [GENDLT-24]: Crash on invalid injection message.Lassi Marttala2012-06-131-0/+6
| | | | | | Check that the size of the injection message is sane. Signed-off-by: Christian Muck <christian.muck@bmw.de>
* [GDLT-89] Daemon doesn't sent the persistent log level, trace status ↵Christian Muck2012-05-301-4/+5
| | | | | | configuration from dlt-runtime files to a new registered context fixed. Signed-off-by: Christian Muck <christian.muck@bmw.de>
* [GDLT-3] Fixed missing semaphore around dlt_buffer_push3Christian Muck2012-05-301-0/+3
| | | | Signed-off-by: Christian Muck <christian.muck@bmw.de>
* Added define statement for initial value of file descriptor and (-1). ↵Christian Muck2012-05-301-15/+15
| | | | | | Updated the user_handle of the daemon and user Signed-off-by: Christian Muck <christian.muck@bmw.de>
* [D4099]: Integrated fix from Alexander Wenzel. This will check forLassi Marttala2012-05-301-1/+50
| | | | | | duplicate file handles, and clean them up if found. Signed-off-by: Christian Muck <christian.muck@bmw.de>
* [GDLT-85] Pipes opened multiple times for the same application pid fixed.Christian Muck2012-05-301-5/+25
| | | | Signed-off-by: Christian Muck <christian.muck@bmw.de>
* GENDLT-15, Fixes to previous integrations from review.Lassi Marttala2012-04-041-1/+1
| | | | Signed-off-by: Christian Muck <christian.muck@bmw.de>
* GENDLT-15, Safe re-allocations for databuffer.Lassi Marttala2012-04-041-8/+26
| | | | Signed-off-by: Christian Muck <christian.muck@bmw.de>
* GENDLT-15, use the correct TEXTBUFSIZELassi Marttala2012-04-041-1/+1
| | | | Signed-off-by: Christian Muck <christian.muck@bmw.de>
* GENDLT-15, Avoid buffer overrun with snprintf().Lassi Marttala2012-04-041-5/+5
| | | | | | | | | | Check return value of dlt_user_log_write_start(_id) correctly. Reduce the number of applications if allocation fails. Make dlt_user_log_write_start inline Improve error checking in dlt_user_log_write_start_id Use databuffersize to avoid reallocations Signed-off-by: Christian Muck <christian.muck@bmw.de>
* GENDLT-15, Rename buffer size constant to avoid confusion.Lassi Marttala2012-04-041-19/+15
| | | | | | | | Better error handling when writing to FIFO. Remove duplicate msg initialization. Optimize away multiple uses of strlen for one check. Signed-off-by: Christian Muck <christian.muck@bmw.de>