summaryrefslogtreecommitdiff
path: root/src/offlinelogstorage/dlt_offline_logstorage_behavior.c
Commit message (Collapse)AuthorAgeFilesLines
* dlt message header brokenDinh Cong Toan2021-06-301-34/+34
| | | | | | | | | | | | | This commit is to revert the following commits: - de4a4234 - fb9ff078 - db9917b3 - e4467f0e - a567e01d Those commits are from improvement but they seem to break the dlt message header in some cases. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* logstorage: fix conversion warningsDinh Cong Toan(RBVH/ECM12)2021-01-061-34/+34
| | | | | | | | | | | | - Some functions like 'strncmp()', 'strncat()', 'strcpy()' and 'memcpy()' take an argument in type 'size_t', so explicit data type to 'size_t' in this case is needed to avoid conversion warnings. - Function 'strlen' return data type 'size_t', which still need to cast data type Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <Toan.DinhCong@vn.bosch.com>
* logstorage: snprintf return checkSaya Sugiura2021-01-061-2/+4
| | | | | | | | | | snprinf will return the number of characters printed if succeeded. related commits: 0ae98e7 snprintf ret > 0 is not always an error 676e8fc fix some gcc9 compiler warnings Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* logstorage: Add debug logsSaya Sugiura2021-01-061-3/+24
| | | | | | | | This commit adds debug logs for opening and scanning DLT log files in Logstorage device. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* logstorage: Modify rearranging fileSaya Sugiura2021-01-061-1/+10
| | | | | | | | | | | | | | This commit updates dlt_logstorage_rearrange_file_name() to perform following: - If the maximum index isn't equal to maxcounter, do not rearrange the file name - If the maximum index reaches to maxcounter: - If minimum index is not 1, do not rearrange the file name - If minimum index is 1, check if there's any indexes which the gap is more than 1. If exists, take those indexes as latest and oldest. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* logstorage: Handle wrap-aroundSaya Sugiura2021-01-061-25/+114
| | | | | | | | In case there is wrap-around, the newest file must be decided based on the biggest wrap_id and corresponding working filename. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com> Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <Toan.DinhCong@vn.bosch.com>
* dlt_offline: fix build failures with gcc-10 (#245)Gianfranco Costamagna2020-09-011-0/+1
| | | | | | | | | | | | | | | see bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=957140 /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_client.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_common.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: multiple definition of `g_logstorage_cache_size'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: first defined here /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_common.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_connection.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: multiple definition of `g_logstorage_cache_size'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: first defined here /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_connection.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_event_handler.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: multiple definition of `g_logstorage_cache_size'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: first defined here /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_event_handler.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_offline_logstorage.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
* logstorage: support all stragegiesBui Nguyen Quoc Thanh2020-07-061-21/+28
| | | | | | | | In case cached-based strategy is used, the information of newest log file must be updated everytime of synchronization to file. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* offline storage: Improvement log messages at bottomBui Nguyen Quoc Thanh2020-07-061-23/+60
| | | | | | | | | | | | | | - In case there are several filters in config dlt_logstorage.conf which are sharing the same file name, the dlt-daemon could not handle to write the dlt messages at the proper file. It means the latest dlt messages might be not written into the newest file. - In order to resolve this, dlt-daemon must keep the newest file for each filename. Everytime new dlt message is going to be written, dlt-daemon must ensure that it must be written out to the newest file. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com> Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* fix some gcc9 compiler warningsFelix Herrmann2020-07-061-9/+13
| | | | | | | | | Many stringop-truncation and stringop-overflow warnings are still there (so many). https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/ Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com> Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* fix clang warnings about GNU stuffFelix Herrmann2020-07-061-27/+20
| | | | | Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com> Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* Fix compiler warnings: pointer of type ‘void *’ used in arithmetic (#196)Sebastian Lipponer2019-12-101-10/+10
| | | Signed-off-by: Sebastian Lipponer <mail@sebastianlipponer.de>
* dlt-system: Call tzset before localtime_r (#165)Saya Sugiura2019-09-231-0/+1
| | | | | | Since localtime() was calling tzset() internally, it should be used before localtime_r(). Refer to man page of localtime_r() for detail. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* doxygen: Remove licenceSaya Sugiura2019-07-191-2/+0
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* doxygen: Get rid of warningsSaya Sugiura2019-07-191-1/+3
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* fix warning of self assignPhong Tran2019-06-241-3/+3
| | | | | | | | | | 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>
* Fix alerts from lgtmSaya Sugiura2019-06-191-7/+8
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.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-181-494/+291
| | | | | | | | | | | | | | | 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>
* Code beautification using uncrustifyChristoph Lipka2018-12-211-362/+224
| | | | Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* Cleanup of unit test fixesManikandan C2018-12-211-3/+2
| | | | Signed-off-by: Manikandan C <mchockalingam@de.adit-jv.com>
* UnitTest: UpdatesManikandanC2018-12-211-0/+1
| | | | | | | | | | | | 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>
* rename #define STATIC to DLT_STATICManikandan C2018-12-061-17/+17
| | | | Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Log storage - Updates (#82)ManikandanChockalingam2018-11-151-136/+750
| | | | | | | | | | - 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>
* Prevent buffer overflow for mount point path in dlt_logstorage_open_log_file ↵pierreN2017-06-161-1/+6
| | | | | (#19) Signed-off-by: Pierre N <pierreN@users.noreply.github.com>
* Offline logstorage: On Demand triggering for syncing Logstorage cache and ↵Christoph Lipka2016-04-251-20/+39
| | | | | | | | support long options Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Change-Id: I2bac5e48a5d210b544a96fe96dc322f28ac472fe
* MultiNode: Logstorage: ECUid as filter attributeChristoph Lipka2015-12-071-0/+1
| | | | | | | | | This patch enables the user to specify the ECU identifier as another filter attribute for a Logstorage filter configuration. This attribute is optional. If not specified, the ECUid will not be checked during message filtering within the Logstorage component. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* DltLogstorage: Logstorage CacheChristoph Lipka2015-11-241-0/+868
When using DltLogstorage on internal storage device, it is needed to reduce writing to internal storage device as much as possible. This patch introduces sync strategies to Logstorage to provide that functionality. The ON_MSG strategy is the default sync strategy that flushes every written log message to the storage device (fflush). The ON_DAEMON_EXIT strategy only flushes data to disk when the daemon exits. The strategy can be defined per filter in the dlt_logstorage.conf configuration file by adding SyncBehavior=<Strategy> to a configuration. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>