From b7124c33826a53a1a66d3c6b7230ebd33735ab4a Mon Sep 17 00:00:00 2001 From: Vo Trung Chi Date: Wed, 20 Mar 2019 14:15:54 +0700 Subject: dlt_offline_logstorage: fix multiple file creation error (#85, #94) 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 --- src/offlinelogstorage/dlt_offline_logstorage_internal.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/offlinelogstorage/dlt_offline_logstorage_internal.h') diff --git a/src/offlinelogstorage/dlt_offline_logstorage_internal.h b/src/offlinelogstorage/dlt_offline_logstorage_internal.h index 11da0dd..9d1eaf7 100644 --- a/src/offlinelogstorage/dlt_offline_logstorage_internal.h +++ b/src/offlinelogstorage/dlt_offline_logstorage_internal.h @@ -56,11 +56,13 @@ DLT_STATIC int dlt_logstorage_list_destroy(DltLogStorageFilterList **list, DLT_STATIC int dlt_logstorage_list_add_config(DltLogStorageFilterConfig *data, DltLogStorageFilterConfig **listdata); DLT_STATIC int dlt_logstorage_list_add(char *key, + int num_keys, DltLogStorageFilterConfig *data, DltLogStorageFilterList **list); -DLT_STATIC void *dlt_logstorage_list_find(char *key, - DltLogStorageFilterList **list); +DLT_STATIC int dlt_logstorage_list_find(char *key, + DltLogStorageFilterList **list, + DltLogStorageFilterConfig **config); DLT_STATIC int dlt_logstorage_count_ids(const char *str); -- cgit v1.2.1