summaryrefslogtreecommitdiff
path: root/src/offlinelogstorage/dlt_offline_logstorage.h
diff options
context:
space:
mode:
authorBui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>2020-05-18 14:52:05 +0700
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2020-07-06 10:04:07 +0900
commitacbbc6b23d6694ee940ad384bf882a4c4ab47af7 (patch)
treed3736b1a99c0a54843eb170d833d92d70eac5be8 /src/offlinelogstorage/dlt_offline_logstorage.h
parent54768d5f559aa9b35ab61c20f4f56e1e9409f17a (diff)
downloadDLT-daemon-acbbc6b23d6694ee940ad384bf882a4c4ab47af7.tar.gz
offline storage: Improvement log messages at bottom
- 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>
Diffstat (limited to 'src/offlinelogstorage/dlt_offline_logstorage.h')
-rw-r--r--src/offlinelogstorage/dlt_offline_logstorage.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/offlinelogstorage/dlt_offline_logstorage.h b/src/offlinelogstorage/dlt_offline_logstorage.h
index 1f7396d..b58da70 100644
--- a/src/offlinelogstorage/dlt_offline_logstorage.h
+++ b/src/offlinelogstorage/dlt_offline_logstorage.h
@@ -52,6 +52,7 @@
#define DLT_OFFLINE_LOGSTORAGE_H
#include <search.h>
+#include <stdbool.h>
#include "dlt_common.h"
#include "dlt-daemon_cfg.h"
#include "dlt_config_file_parser.h"
@@ -139,7 +140,7 @@ typedef struct DltLogStorageFileList
/* List for filenames */
char *name; /* Filename */
unsigned int idx; /* File index */
- struct DltLogStorageFileList *next;
+ struct DltLogStorageFileList *next; /* Pointer to next */
} DltLogStorageFileList;
typedef struct DltLogStorageFilterConfig DltLogStorageFilterConfig;
@@ -152,6 +153,7 @@ struct DltLogStorageFilterConfig
int log_level; /* Log level number configured for filter */
int reset_log_level; /* reset Log level to be sent on disconnect */
char *file_name; /* File name for log storage configured for filter */
+ char *working_file_name; /* Current open log file name */
unsigned int file_size; /* MAX File size of storage file configured for filter */
unsigned int num_files; /* MAX number of storage files configured for filters */
int sync; /* Sync strategy */
@@ -160,7 +162,8 @@ struct DltLogStorageFilterConfig
int (*dlt_logstorage_prepare)(DltLogStorageFilterConfig *config,
DltLogStorageUserConfig *file_config,
char *dev_path,
- int log_msg_size);
+ int log_msg_size,
+ char *newest_file);
int (*dlt_logstorage_write)(DltLogStorageFilterConfig *config,
DltLogStorageUserConfig *file_config,
char *dev_path,
@@ -193,6 +196,15 @@ struct DltLogStorageFilterList
DltLogStorageFilterList *next; /* Pointer to next */
};
+typedef struct DltNewestFileName DltNewestFileName;
+
+struct DltNewestFileName
+{
+ char *file_name; /* The unique name of file in whole a dlt_logstorage.conf */
+ char *newest_file; /* The real newest name of file which is associated with filename.*/
+ DltNewestFileName *next; /* Pointer to next */
+};
+
typedef struct
{
DltLogStorageFilterList *config_list; /* List of all filters */
@@ -202,6 +214,7 @@ typedef struct
unsigned int connection_type; /* Type of connection */
unsigned int config_status; /* Status of configuration */
int write_errors; /* number of write errors */
+ DltNewestFileName *newest_file_list; /* List of newest file name */
} DltLogStorage;
typedef struct {