From 711c9b884cf8f869511b31133dc9f7959c9ab843 Mon Sep 17 00:00:00 2001 From: Saya Sugiura Date: Tue, 19 Feb 2019 13:52:18 +0900 Subject: Logstorage: Sync behavior bug fix 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 --- src/daemon/dlt_daemon_offline_logstorage.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/daemon/dlt_daemon_offline_logstorage.c') diff --git a/src/daemon/dlt_daemon_offline_logstorage.c b/src/daemon/dlt_daemon_offline_logstorage.c index f915086..8a6dd75 100644 --- a/src/daemon/dlt_daemon_offline_logstorage.c +++ b/src/daemon/dlt_daemon_offline_logstorage.c @@ -1115,9 +1115,20 @@ int dlt_daemon_logstorage_cleanup(DltDaemon *daemon, /* call disconnect on all currently connected devices */ if (daemon->storage_handle[i].connection_type == DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED) + { + (&daemon->storage_handle[i])->uconfig.logfile_counteridxlen = + daemon_local->flags.offlineLogstorageMaxCounterIdx; + (&daemon->storage_handle[i])->uconfig.logfile_delimiter = + daemon_local->flags.offlineLogstorageDelimiter; + (&daemon->storage_handle[i])->uconfig.logfile_maxcounter = + daemon_local->flags.offlineLogstorageMaxCounter; + (&daemon->storage_handle[i])->uconfig.logfile_timestamp = + daemon_local->flags.offlineLogstorageTimestamp; + dlt_logstorage_device_disconnected( &daemon->storage_handle[i], DLT_LOGSTORAGE_SYNC_ON_DAEMON_EXIT); + } return 0; } -- cgit v1.2.1