summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* libdlt: Do not allow DLT usage in forked child (#95)Simon Herkenhoff2019-02-042-42/+74
| | | | | | | | | | | | | 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>
* Make dlt-convert more responsive when watching a fileAigars Mahinovs2019-02-021-1/+1
|
* Code beautification using uncrustifyChristoph Lipka2018-12-21102-16948/+14032
| | | | 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-2111-105/+109
| | | | Signed-off-by: Manikandan C <mchockalingam@de.adit-jv.com>
* libdlt: Add error handlingSaya Sugiura2018-12-212-70/+141
| | | | | | | 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>
* 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-2125-129/+556
| | | | | | | | | | | | 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-215-48/+82
| | | | | | | | 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>
* 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>
* buffer: Code cleanupSaya Sugiura2018-12-211-48/+56
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* buffer: Improve loggingSaya Sugiura2018-12-211-43/+51
| | | | | | | Add more logs to places where any pointer of buffer may get modified, to get more information when we get unexpected behaviour Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Removed log level change callback notification while context register done ↵Ravi Sankar P2018-12-212-8/+12
| | | | | | 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-212-150/+209
| | | | | | 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-212-39/+117
| | | | | | private data as argument Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Fixed compiler error with previous commitManikandan C2018-12-122-3/+3
| | | | Signed-off-by: Manikandan C <mchockalingam@de.adit-jv.com>
* Dynamic allocation of msg bufferManikandanC2018-12-109-230/+430
| | | | | | | | | | | | | 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-067-88/+87
| | | | Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Use poll in the dlt-daemon for POSIX complianceManikandanC2018-11-3018-235/+416
| | | | | | | | | | | 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-238-37/+32
| | | | | | | | | | | - 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>
* dlt-control: update get log infoSaya Sugiura2018-11-231-8/+17
| | | | | | | - Context printing in dlt_process_get_log_info function updated - Parameter in dlt_set_loginfo_parse_service_id function fixed Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Protocol: DLT Service ID Enum instead of definesManikandan C2018-11-233-2/+92
| | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Gateway ImprovementsManikandan C2018-11-2312-807/+1490
| | | | | | | | | | | | | -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-1514-1368/+3593
| | | | | | | | | | - 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>
* Fflush stdout in the intenal logger (#81)Alexander Menzhinsky2018-10-301-0/+1
|
* dlt-daemon: per ECU list of user information (#80)ManikandanChockalingam2018-10-306-344/+883
| | | | | | 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>
* Add dlt-sortbytimestamp utility plus documentation (#73)eBardieCT2018-09-252-1/+424
| | | | | | | | | | | | | | | * Add dlt-sortbytimestamp utility plus documentation Add a commandline utility to sort a DLT file by timestamp. By default a DLT file's messages are in the order they were received by the logger. This is not ideal for tracing problems on systems with multi-threaded programmes running on multi-core CPUs since message reception order will not always (or even often) correspond to message creation order. The documentation deals with how to handle the problem case of DLT files containing messages from multiple boot cycles.
* 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>
* Fix gcc 8 build (#74)Jesus Sanchez-Palencia2018-09-252-2/+2
| | | | | | | | | | | | * dlt-control-common: Fix build with GCC 8: When the "stringop-truncation" warning is treated as an error, the build fails with the following message: * dlt-control-common.c:213:29: error: ‘strncpy’ output may be truncated copying 255 bytes from a string of length 1023 [-Werror=stringop-truncation] On this file we want to truncate the string due to the destination buffer size, so fix the above by using memcpy() instead. * dlt-logstorage-common: Fix build with GCC 8: When the "stringop-truncation" warning is treated as an error, the build fails with the following message: * dlt-logstorage-common.c:313:5: error: ‘strncpy’ specified bound 1024 equals destination size [-Werror=stringop-truncation] In order to avoid truncating and leaving the '\0' byte out, reduce the bound by 1 byte. * systemd/3rdparty: Fix sd-daemon build with GCC 8: When the "stringop-truncation" warning is treated as an error, the build fails with the following message: * sd-daemon.c:453:9: error: ‘strncpy’ specified bound 108 equals destination size. In order to avoid truncating and leaving the '\0' byte out, reduce the bound by 1 byte. Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
* dlt-daemon: fixed linked-list element remove (#71)Konstantyn2018-08-241-7/+15
|
* 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)
* 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>
* file parser: Replace hash functions with list (#67)ManikandanChockalingam2018-07-122-62/+59
| | | | | | | | file parser: Replace hash functions with list Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* 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>
* 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-1812-195/+491
| | | | | | | | | * 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-186-61/+331
| | | | | | | | | | | | | | | | | | | | | * 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>
* dlt-control: Fix Setting default trace status issue (#53)Yusuke Sato2018-05-081-3/+3
| | | | | Default trace status could not be set by "-f" option. 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.