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.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/offlinelogstorage/dlt_offline_logstorage.h') diff --git a/src/offlinelogstorage/dlt_offline_logstorage.h b/src/offlinelogstorage/dlt_offline_logstorage.h index c2160b5..e28e535 100644 --- a/src/offlinelogstorage/dlt_offline_logstorage.h +++ b/src/offlinelogstorage/dlt_offline_logstorage.h @@ -60,7 +60,7 @@ #include "dlt_config_file_parser.h" #define DLT_OFFLINE_LOGSTORAGE_MAXIDS 100 /* Maximum entries for each apids and ctids */ -#define DLT_OFFLINE_LOGSTORAGE_MAX_POSSIBLE_CONFIGS 7 /* max number of possible filters when searching for */ +#define DLT_OFFLINE_LOGSTORAGE_MAX_POSSIBLE_KEYS 7 /* Max number of possible keys when searching for */ #define DLT_OFFLINE_LOGSTORAGE_INIT_DONE 1 /* For device configuration status */ #define DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED 1 @@ -191,7 +191,8 @@ typedef struct DltLogStorageFilterList DltLogStorageFilterList; struct DltLogStorageFilterList { - char *key; /* Key to find data */ + char *key_list; /* List of key */ + int num_keys; /* Number of keys */ DltLogStorageFilterConfig *data; /* Filter data */ DltLogStorageFilterList *next; /* Pointer to next */ }; @@ -199,9 +200,8 @@ struct DltLogStorageFilterList typedef struct { DltLogStorageFilterList *config_list; /* List of all filters */ - DltLogStorageUserConfig uconfig; /* User configurations for file name*/ - int num_configs; /* Number of configs */ - int num_filter_keys; /* Number of keys */ + DltLogStorageUserConfig uconfig; /* User configurations for file name*/ + int num_configs; /* Number of configs */ char device_mount_point[DLT_MOUNT_PATH_MAX + 1]; /* Device mount path */ unsigned int connection_type; /* Type of connection */ unsigned int config_status; /* Status of configuration */ -- cgit v1.2.1