summaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
authorManikandan C <Manikandan.Chockalingam@in.bosch.com>2015-08-28 17:12:55 +0530
committerLutz Helwing <lutz_helwing@mentor.com>2015-11-18 16:14:00 +0100
commit18f3332a363b98fca6345514c35fa10761e36c8e (patch)
tree05e2bb1d4329ab84b6e618cb3e8de60fc57e78ac /src/daemon
parent5e1270dec72c175ad3ad3a26d2c3d402d0e07ebe (diff)
downloadDLT-daemon-18f3332a363b98fca6345514c35fa10761e36c8e.tar.gz
offline trace: supported trace file name configuration based on index
Changes made for trace file name configuration based on index and made it configurable from dlt.conf file. Using this configuration one can select either timestamp based or index based log file creation for offline trace. Signed-off-by: Manikandan C <Manikandan.Chockalingam@in.bosch.com>
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/dlt-daemon.c12
-rw-r--r--src/daemon/dlt-daemon.h1
-rw-r--r--src/daemon/dlt.conf3
3 files changed, 15 insertions, 1 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c
index fb9fe22..4e6b4b4 100644
--- a/src/daemon/dlt-daemon.c
+++ b/src/daemon/dlt-daemon.c
@@ -216,6 +216,7 @@ int option_file_parser(DltDaemonLocal *daemon_local)
daemon_local->flags.offlineTraceDirectory[0] = 0;
daemon_local->flags.offlineTraceFileSize = 1000000;
daemon_local->flags.offlineTraceMaxSize = 0;
+ daemon_local->flags.offlineTraceFilenameTimestampBased = 1;
daemon_local->flags.loggingMode = DLT_LOG_TO_CONSOLE;
daemon_local->flags.loggingLevel = LOG_INFO;
snprintf(daemon_local->flags.loggingFilename, sizeof(daemon_local->flags.loggingFilename)-1, "%s/dlt.log", dltFifoBaseDir);
@@ -394,6 +395,11 @@ int option_file_parser(DltDaemonLocal *daemon_local)
daemon_local->flags.offlineTraceMaxSize = atoi(value);
//printf("Option: %s=%s\n",token,value);
}
+ else if(strcmp(token,"OfflineTraceFileNameTimestampBased")==0)
+ {
+ daemon_local->flags.offlineTraceFilenameTimestampBased = atoi(value);
+ //printf("Option: %s=%s\n",token,value);
+ }
else if(strcmp(token,"SendECUSoftwareVersion")==0)
{
daemon_local->flags.sendECUSoftwareVersion = atoi(value);
@@ -684,7 +690,11 @@ int dlt_daemon_local_init_p2(DltDaemon *daemon, DltDaemonLocal *daemon_local, in
/* init offline trace */
if(((daemon->mode == DLT_USER_MODE_INTERNAL) || (daemon->mode == DLT_USER_MODE_BOTH)) && daemon_local->flags.offlineTraceDirectory[0])
{
- if (dlt_offline_trace_init(&(daemon_local->offlineTrace),daemon_local->flags.offlineTraceDirectory,daemon_local->flags.offlineTraceFileSize,daemon_local->flags.offlineTraceMaxSize)==-1)
+ if (dlt_offline_trace_init(&(daemon_local->offlineTrace),
+ daemon_local->flags.offlineTraceDirectory,
+ daemon_local->flags.offlineTraceFileSize,
+ daemon_local->flags.offlineTraceMaxSize,
+ daemon_local->flags.offlineTraceFilenameTimestampBased)==-1)
{
dlt_log(LOG_ERR,"Could not initialize offline trace\n");
return -1;
diff --git a/src/daemon/dlt-daemon.h b/src/daemon/dlt-daemon.h
index 0096ba6..0e2fe37 100644
--- a/src/daemon/dlt-daemon.h
+++ b/src/daemon/dlt-daemon.h
@@ -105,6 +105,7 @@ typedef struct
char offlineTraceDirectory[256]; /**< (String: Directory) Store DLT messages to local directory (Default: /etc/dlt.conf) */
int offlineTraceFileSize; /**< (int) Maximum size in bytes of one trace file (Default: 1000000) */
int offlineTraceMaxSize; /**< (int) Maximum size of all trace files (Default: 4000000) */
+ int offlineTraceFilenameTimestampBased; /**< (int) timestamp based or index based (Default: 1 Timestamp based) */
int loggingMode; /**< (int) The logging console for internal logging of dlt-daemon (Default: 0) */
int loggingLevel; /**< (int) The logging level for internal logging of dlt-daemon (Default: 6) */
char loggingFilename[256]; /**< (String: Filename) The logging filename if internal logging mode is log to file (Default: /tmp/log) */
diff --git a/src/daemon/dlt.conf b/src/daemon/dlt.conf
index 5976c1f..d9b0987 100644
--- a/src/daemon/dlt.conf
+++ b/src/daemon/dlt.conf
@@ -66,6 +66,9 @@ RingbufferStepSize = 500000
# Maximum size of all trace files (Default: 4000000)
# OfflineTraceMaxSize = 4000000
+# Filename timestamp based or index based (Default:1) (timestamp based=1, index based =0)
+# OfflineTraceFileNameTimestampBased = 1
+
########################################################################
# Local console output configuration #
########################################################################