summaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
authorChristoph Lipka <clipka@de.adit-jv.com>2014-12-17 16:58:12 +0900
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2015-03-17 10:26:12 +0100
commitdb5b62a1c054667dc82929d90e195cd4a7060f4c (patch)
treefe840eb3b4fea4901a0d7299e87310844b33ff83 /src/daemon
parente0d403808a68c1c0309824c0df3b353a8aad7d16 (diff)
downloadDLT-daemon-db5b62a1c054667dc82929d90e195cd4a7060f4c.tar.gz
Workaround for duplicated log messages in offline trace file issue
Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/dlt-daemon.c4
-rw-r--r--src/daemon/dlt_daemon_client.c8
-rw-r--r--src/daemon/dlt_daemon_client.h3
3 files changed, 8 insertions, 7 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c
index 1a98ca9..621fcc9 100644
--- a/src/daemon/dlt-daemon.c
+++ b/src/daemon/dlt-daemon.c
@@ -2035,7 +2035,7 @@ int dlt_daemon_process_user_message_log(DltDaemon *daemon, DltDaemonLocal *daemo
/* send message to client or write to log file */
if((ret = dlt_daemon_client_send(DLT_DAEMON_SEND_TO_ALL,daemon,daemon_local,daemon_local->msg.headerbuffer+sizeof(DltStorageHeader),daemon_local->msg.headersize-sizeof(DltStorageHeader),
- daemon_local->msg.databuffer,daemon_local->msg.datasize,verbose)))
+ daemon_local->msg.databuffer,daemon_local->msg.datasize,verbose,0)))
{
if(ret == DLT_DAEMON_ERROR_BUFFER_FULL)
{
@@ -2404,7 +2404,7 @@ int dlt_daemon_send_ringbuffer_to_client(DltDaemon *daemon, DltDaemonLocal *daem
while ( (length = dlt_buffer_copy(&(daemon->client_ringbuffer), data, sizeof(data)) ) > 0)
{
- if((ret = dlt_daemon_client_send(DLT_DAEMON_SEND_FORCE,daemon,daemon_local,data,length,0,0,verbose)))
+ if((ret = dlt_daemon_client_send(DLT_DAEMON_SEND_FORCE,daemon,daemon_local,data,length,0,0,verbose,0)))
{
return ret;
}
diff --git a/src/daemon/dlt_daemon_client.c b/src/daemon/dlt_daemon_client.c
index b0a11c9..041a105 100644
--- a/src/daemon/dlt_daemon_client.c
+++ b/src/daemon/dlt_daemon_client.c
@@ -58,7 +58,7 @@
/** Global text output buffer, mainly used for creation of error/warning strings */
static char str[DLT_DAEMON_TEXTBUFSIZE];
-int dlt_daemon_client_send(int sock,DltDaemon *daemon,DltDaemonLocal *daemon_local,void* data1,int size1,void* data2,int size2,int verbose)
+int dlt_daemon_client_send(int sock,DltDaemon *daemon,DltDaemonLocal *daemon_local,void* data1,int size1,void* data2,int size2,int verbose, int control)
{
int ret;
int j;
@@ -96,7 +96,7 @@ int dlt_daemon_client_send(int sock,DltDaemon *daemon,DltDaemonLocal *daemon_loc
}
/* write message to offline trace */
- if ((sock!=DLT_DAEMON_SEND_FORCE) && (daemon->state == DLT_DAEMON_STATE_SEND_DIRECT))
+ if ((sock!=DLT_DAEMON_SEND_FORCE) && (daemon->state == DLT_DAEMON_STATE_SEND_DIRECT) && !control)
{
if(((daemon->mode == DLT_USER_MODE_INTERNAL) || (daemon->mode == DLT_USER_MODE_BOTH))
&& daemon_local->flags.offlineTraceDirectory[0])
@@ -269,7 +269,7 @@ int dlt_daemon_client_send_control_message( int sock, DltDaemon *daemon, DltDaem
msg->standardheader->len = DLT_HTOBE_16(((uint16_t)len));
if((ret=dlt_daemon_client_send(sock,daemon,daemon_local,msg->headerbuffer+sizeof(DltStorageHeader),msg->headersize-sizeof(DltStorageHeader),
- msg->databuffer,msg->datasize,verbose)))
+ msg->databuffer,msg->datasize,verbose,1)))
{
dlt_log(LOG_DEBUG,"dlt_daemon_control_send_control_message: DLT message send to all failed!.\n");
return ret;
@@ -1610,7 +1610,7 @@ void dlt_daemon_control_message_time(int sock, DltDaemon *daemon, DltDaemonLocal
/* Send message */
if((ret = dlt_daemon_client_send(sock,daemon,daemon_local,msg.headerbuffer+sizeof(DltStorageHeader),msg.headersize-sizeof(DltStorageHeader),
- msg.databuffer,msg.datasize,verbose)))
+ msg.databuffer,msg.datasize,verbose,1)))
{
}
diff --git a/src/daemon/dlt_daemon_client.h b/src/daemon/dlt_daemon_client.h
index c9ceec4..c300d93 100644
--- a/src/daemon/dlt_daemon_client.h
+++ b/src/daemon/dlt_daemon_client.h
@@ -72,9 +72,10 @@
* @param data2 pointer to data
* @param size2 size of data
* @param verbose if set to true verbose information is printed out.
+ * @param control if set to true message is not stored in offline trace
* @return unequal 0 if there is an error or buffer is full
*/
-int dlt_daemon_client_send(int sock,DltDaemon *daemon,DltDaemonLocal *daemon_local,void* data1,int size1,void* data2,int size2,int verbose);
+int dlt_daemon_client_send(int sock,DltDaemon *daemon,DltDaemonLocal *daemon_local,void* data1,int size1,void* data2,int size2,int verbose, int control);
/**
* Send out response message to dlt client