summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* doxygen: Remove licenceSaya Sugiura2019-07-19132-264/+0
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* doxygen: Get rid of warningsSaya Sugiura2019-07-1925-70/+103
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* cmake: Allow build as a subproject (#145)Vo Trung Chi2019-07-093-9/+9
| | | | | | Use PROJECT_* instead of CMAKE_* to allow build as a subproject of another cmake project. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* fix config path for dlt-dbusRadoslaw Kaczorowski2019-07-034-9/+10
| | | | | | use default config path relative to CONFIGURATION_FILES_DIR Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* define DLT_PATH_MAX for max path buffer lengthRadoslaw Kaczorowski2019-07-034-24/+29
| | | | | | | | DLT limits the path length and does not do anything else to determine the actual value, because the least that is supported on any system that DLT runs on is 1024 bytes. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* cmake-improvements (#135)Vo Trung Chi2019-07-034-105/+117
| | | | | | | | | | | | | | | 1. Allow building as a subproject of another cmake project (CMAKE_* vs PROJECT_* variables) 2. Do not generate header files within source – bad practice, use build directory for that(e.g. change location where dlt_version.h is being generated) 3. Use add_compile_options() instead of *_C/CXX_FLAGS variables for proper compile environment definition, also bad practice, also see p.2 4. Add WITH_DLT_PKGCONFIG – add generate pkgconfig .pc files as switchable option, should probably be part of headers install routine. Signed-off-by: Radoslaw Kaczorowski <external.radoslaw.kaczorowski@bosch-softtec.com>
* libdlt: Use posix nanosleep (#144)Phong Tran2019-06-271-2/+9
| | | | | Change to use nanosleep instead of usleep. Signed-off-by: Phong Tran <tranmanphong@gmail.com>
* fix the warning of strncat sizePhong Tran2019-06-241-4/+4
| | | | | | | | | | | | | clang warns that warning: size argument in 'strncat' call appears to be size of the source [-Wstrncat-size] strncat(log_file_name, file_index, sizeof(file_index)); ^~~~~~~~~~~~~~~~~~ do as the https://github.com/llvm-mirror/clang/blob/05be53c9524408516651d5678d55d0d4a5d3a894/test/Sema/warn-strncat-size.c#L30 Signed-off-by: Phong Tran <tranmanphong@gmail.com>
* fix warning of self assignPhong Tran2019-06-244-7/+7
| | | | | | | | | | use (void)xyz instead of self assign error log: error: explicitly assigning value of variable of type 'void *' to itself [-Werror,-Wself-assign] Signed-off-by: Phong Tran <tranmanphong@gmail.com>
* dlt-convert: fix warning of wrong conversionPhong Tran2019-06-241-1/+4
| | | | | | | | | | | change to use usleep dlt-daemon/src/console/dlt-convert.c:346:35: warning: implicit conversion from 'double' to 'unsigned int' changes value from 0.1 to 0 [-Wliteral-conversion] sleep(0.1); Signed-off-by: Phong Tran <tranmanphong@gmail.com>
* cleanup: Use dlt_vlog()Saya Sugiura2019-06-1911-371/+156
| | | | | | | There were a couple of places which used snprintf-dlt_log. It is now replaced with dlt_vlog(). Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Fix alerts from lgtmSaya Sugiura2019-06-1911-58/+56
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* dlt-test: Improve context IDBui Nguyen Quoc Thanh2019-06-181-14/+37
| | | | | | | | | New option for binary dlt-test-multi-process. The format of context id is constructed based on appId. Previously, context id is generated randomly. Now test binary can support below testcase: - Multiple apps can share the same context id. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* dlt-test: Add optionsBui Nguyen Quoc Thanh2019-06-181-2/+45
| | | | | | | Support two options for dlt-test-filestransfer to specify the absolute path to tested files. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* libdlt: Remove commented out codeSaya Sugiura2019-06-181-33/+0
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Remove dlt_forward_msgSaya Sugiura2019-06-181-106/+0
| | | | | | Since dlt_forward_msg() is not used anywhere, we will remove it. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* libdlt: compare dlt_ll_ts to NULLSaya Sugiura2019-06-181-4/+4
| | | | | | This commit fixes dlt_user.dlt_ll_ts to compare to NULL instead of 0. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* network trace: Define package ID macroSaya Sugiura2019-06-182-12/+12
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* daemon: Loop for client fdsVo Trung Chi2019-06-183-19/+21
| | | | | | | | | | | | In dlt_daemon_client_send_all_multiple(), while in the loop, the connection to client may be destroyed by recursive call to dlt_daemon_close_socket(). So in some scenario we still use the removed connection, which is unexpected behavior. Solution: loop on the fds array and find the client connection corresponds to. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* daemon: Remove bytes_sentSaya Sugiura2019-06-185-42/+6
| | | | | | | | | | | | | | | | | | | | | When it fails to send a log message to connected client, daemon tries to store the remaining partial message to internal ring buffer and send again later. When calculating the number of bytes which were sent to client, it had a bug which it keeps on incrementing instead of initializing the variable on every message, which never reached to the condition mentioned above and had a possibility to overflow and access invalid memory. On the other hand, daemon doesn't need to store the unsent partial message, as the socket to the client will be closed on failure and the sent partial message will be dropped anyways. This commit removes the lines where the daemon tries to store the partial message to ring buffer. With this, variable bytes_sent is now removed. Related commit: 2262f8b Made socket send reliable Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* daemon: Don't remove unregistered contextBui Nguyen Quoc Thanh2019-06-183-1/+15
| | | | | | | | If a context is defined and loaded from runtime context config file, that context won't be deleted/removed from dlt-daemon database until its parent application is unregistered. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* daemon: Don't assign fd after freeBui Nguyen Quoc Thanh2019-06-181-3/+0
| | | | | | Do not assign fd after destroying receiver pointer Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* test: Add manual interruption in dlt-test-stressBui Nguyen Quoc Thanh2019-06-181-7/+21
| | | | | | | - Add an environment variable to handle interruption of test. - By default, test1 won't wait for manual interruption anymore. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* Logstorage: Correct behavior in sync message cacheBui Nguyen Quoc Thanh2019-06-181-11/+28
| | | | | | | | If the message size is equal to remaining size of cache, it is still written into cache. And then whole cache data must be synchronized to file according to strategy. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* Logstorage: Sync behavior bug fixSaya Sugiura2019-06-187-516/+327
| | | | | | | | | | | | | | | This commit fixes couple of unexpected behavior on Logstorage sync behavior. - A log file is created only if necessary to avoid creating an empty log file. - The cache is synced with the condition: 1) When the ring buffer is not wrapped around, the cache is synced from last sync offset to current offset 2) When the ring buffer is wrapped around for first time and current offset is smaller than last sync offset, the cache is synced from last sync offset to end sync offset, and then from beginning to current offset 3) Otherwise, the cache is synced from offset where the log message starts to end sync offset, and then from beginning to current offset Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Logstorage: Fix write msg cacheSaya Sugiura2019-06-181-6/+2
| | | | | | | When the message is just fitting to the remaining cache, it is ignored and goes to the head. This commit fixes to add the message to the end. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* libdlt: Fix compiler warningsSaya Sugiura2019-06-111-0/+2
| | | | | | Fix the warning from -Wmaybe-uninitialized. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* lib: unlock buffer on terminationS. Hameed2019-05-241-24/+27
| | | | | | | | | | | | | | | | | | | | | | | | | Sometimes it happens that internal threads present in DLT library are cancelled with one of the task still holding the mutex, then the main task gets locked forever. The following changes have been made: - Cleanup on thread cancellation with pthread_cleanup_push() is introduced - Locking on the message queue lock and subsequent signaling in dlt_stop_threads is only done if the segmented thread was created. - It is unnecessary to have a robust mutex for the message queue. Replace it with a normal mutex and remove EOWNERDEAD logic. Add a pthread_cancel handler to the segmented thread that might hold the message queue mutex. - Message queue mutex is statically initialized Signed-off-by: S. Hameed <shameed@jp.adit-jv.com> Signed-off-by: Jeevan Ramakant Nagvekar <jeevan.nagvekar1@wipro.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* dlt-receive: Fix crash without argumentsVo Trung Chi2019-05-061-4/+6
| | | | | | Rootcause: Free uninitialize memory. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* dlt-control: Bug fix for broken get log infoRavi Sankar P2019-05-061-1/+1
| | | | | | | | strtol converts extra data in the array, so it leads to data crash. It is now fixed to fill the last byte of the array with null character once data copy complete and before convert. Signed-off-by: Ravi Sankar P <ponnurangamravi.sankar@in.bosch.com>
* Logging: Error message modificationManikandanC2019-05-061-8/+16
| | | | | | | Error message is printed only in error case and not in case of expected failure. Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* dlt-daemon: fix internal logging to file after daemonizeChristoph Lipka2019-05-062-1/+6
| | | | Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* Offline logstorage: Fix storage handle NULL check during cleanupS. Hameed2019-05-061-1/+1
| | | | Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
* Fix compiler warningsSimon Herkenhoff2019-05-068-31/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix compiler warnings about socket usage Correct the data types used for the socket declaration. We use AF_UNIX sockets so we use struct sockaddr_un, but we need to cast to struct sockaddr for the socket API. Fix compiler warnings about sign-compare Fix two occurences of signed - unsigned comparison by casting the values accordingly. Note that the cast is legal as the first parts of both conditional statements make sure the value is not negative before casting to unsigned. While at it, add strtol error checking. Fix compiler warnings about string functions Add string.h to src/daemon/dlt_daemon_unix_socket.c, because it was unaware of memcpy and strerror. While at it, change unsafe use of sprintf to proper dlt_vlog and remove the char buffer. Fix compiler warnings about unused-* Fix two unused-variable and one unused-parameter warning. While at it, change the #ifdef to not run into an empty block. Simply reverse the condition and enclose the complete else with the #ifdef. POSIX: Use memset instead of bzero "The bzero() function is deprecated (marked as LEGACY in POSIX.1-2001); use memset(3) in new programs." Use memset instead of bzero and remove any occurrence from DLT. Include of header "strings.h" that has bzero is also removed. Signed-off-by: Simon Herkenhoff <sherkenhoff@jp.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com> Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* POSIX: Replace usleep with nanosleepSaya Sugiura2019-05-0614-35/+106
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* unix socket: IPC code isolationChristoph Lipka2019-05-063-16/+12
| | | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* lib: daemon: Fix sem lock potential issueSaya Sugiura2019-04-241-2/+6
| | | | | | | | sem_wait may return an error if a signal is received while waiting for the lock,and therefore not take the lock before returning. Changed to have a while loop. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* socket: Remove unnecessary headerSaya Sugiura2019-04-241-1/+0
| | | | | | | | Including net/if.h leads to duplicate definition of DLT_RAW. However the header itself is not required in dlt_daemon_socket.c. So it is now removed from the file. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* dlt-daemon: unlink application socketS. Hameed2019-04-241-0/+5
| | | | Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
* ipc: close socket if connect failedChristoph Lipka2019-04-241-0/+2
| | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Size of Resend buffer less than or equal to DLT_USER_BUF_MAX_SIZE res… (#116)kundatipradeep2019-04-151-1/+4
| | | | | | | * Size of Resend buffer less than or equal to DLT_USER_BUF_MAX_SIZE results in Memory corruption. As older version of DLT DLT_USER_RESENDBUF_MAX_SIZE is [DLT_USER_BUF_MAX_SIZE + 100] which contains space for extra headers, where as in DLT 2.18 the resend buffer is bound to DLT_USER_BUF_MAX_SIZE which results in memory corruption in dlt_buffer_read_block when the size of the data is more than DLT_USER_BUF_MAX_SIZE. Reason for not using "DLT_USER_RESENDBUF_MAX_SIZE" during dynamic memory allocation of resend buffer is as user has got the feasibility to alter the DLT_USER_BUF_MAX_SIZE using the environmental variables the resend buffer in any scenario to be greater then dlt_user.log_buf_len to accommodate the extra headers.
* Fixed memory leak when receiving network traces of 0xFFFF lengthjiripopek2019-04-111-2/+4
| | | | | | | | 0xFFFF was used as a magic number in the length field of a network message in order to trigger a resend. DLT library will now use the nw_trace_type field and a custom type to do this, thus assuring no external client of the library can reach this value(DLT_NW_TRACE_RESEND).
* lib: Add mq_close/mq_unlink conditionsSaya Sugiura2019-03-271-5/+12
| | | | | | | | | | Even if network trace is not used in the application, the library will call mq_close() and mq_unlink() to segmented queue handles and queue names, which triggers unnecessary close(). It is now modified to call mq_close() and mq_unlink() only when network trace is initialized. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* dlt_offline_logstorage: fix multiple file creation error (#85, #94)Vo Trung Chi2019-03-254-139/+215
| | | | | | | | | | | | | | | | | | Rootcause: The dlt-daemon rotates files for each key, but not for each [FILTER] because dlt-daemon creates the DltLogStorageFilterConfig for each key (CTXT: or APPID: or APPID:CTXTID) then added to the DltLogStorageFilterList. And each DltLogStorageFilterConfig has it's own records (The list of files that was recorded in the offline logstorage directory), that's why one [FILTER] might be has multiple records and then its lead to the problem. Solution: Instead of creating the DltLogStorageFilterConfig for each key, dlt-daemon will create the DltLogStorageFilterConfig for each [FILTER] and DltLogStorageFilterConfig has an information of all the keys in this [FILTER]. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* 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>