diff options
-rw-r--r-- | daemon/da_protocol.c | 2 | ||||
-rw-r--r-- | daemon/daemon.h | 16 | ||||
-rw-r--r-- | daemon/debug.c | 4 | ||||
-rw-r--r-- | daemon/debug.h | 9 | ||||
-rw-r--r-- | daemon/threads.c | 2 |
5 files changed, 8 insertions, 25 deletions
diff --git a/daemon/da_protocol.c b/daemon/da_protocol.c index e19fc7b..426bfd4 100644 --- a/daemon/da_protocol.c +++ b/daemon/da_protocol.c @@ -549,11 +549,11 @@ static char *parse_replay_event_seq(struct msg_buf_t *msg, } parse_deb("count\n"); - LOGE("events num=%d\n", res->event_num); if (!parse_int32(msg, &res->event_num)) { LOGE("event num parsing error\n"); return 0; } + parse_deb("events num=%d\n", res->event_num); res->events = (struct replay_event_t *)malloc(res->event_num * sizeof(*res->events)); diff --git a/daemon/daemon.h b/daemon/daemon.h index f8b194c..7b5e3f0 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -42,20 +42,6 @@ extern "C" { #endif -/* - * DEBUG DEFINES - */ -#define DEB_PRINTBUF - -#ifndef DEB_PRINTBUF - #define printBuf() do {} while(0) -#endif - -/* - * END DEBUG DEFINES - */ - - #define PROTOCOL_VERSION "2.1" @@ -244,8 +230,6 @@ int sendACKCodeToHost(enum HostMessageType resp, int msgcode); void terminate_all(); void _device_write(input_dev *dev, struct input_event* in_ev); -// DEBUGS -void printBuf (char * buf, int len); #ifdef __cplusplus } diff --git a/daemon/debug.c b/daemon/debug.c index f25599f..baf6160 100644 --- a/daemon/debug.c +++ b/daemon/debug.c @@ -64,4 +64,8 @@ void printBuf (char * buf, int len) LOGI("%s\n",local_buf); } } +#else +inline void printBuf (char * buf, int len){ + return; +} #endif diff --git a/daemon/debug.h b/daemon/debug.h index 8ffbb84..d5f3fba 100644 --- a/daemon/debug.h +++ b/daemon/debug.h @@ -50,15 +50,13 @@ extern "C" { //DEBUG ON PARSING #ifdef PARSE_DEBUG_ON -#define parse_deb(...) LOGI(__VA_ARGS__) +#define parse_deb LOGI #else #define parse_deb(...) do{}while(0) #endif /*parse_on*/ //PRINT BUFFER DEBUG -#ifndef DEB_PRINTBUF - #define printBuf() do {} while(0) -#endif +void printBuf (char * buf, int len); //THREAD SAMPLING DEBUG #ifdef THREAD_SAMPLING_DEBUG @@ -104,8 +102,7 @@ extern "C" { #define LOGW(...) do{} while(0) #endif -// DEBUGS -void printBuf (char * buf, int len); + #ifdef __cplusplus } diff --git a/daemon/threads.c b/daemon/threads.c index ac1d40b..85e3158 100644 --- a/daemon/threads.c +++ b/daemon/threads.c @@ -292,9 +292,7 @@ void* samplingThread(void* data) write_to_buf(msg); -#ifdef THREAD_SAMPLING_DEBUG printBuf((char *)msg, MSG_DATA_HDR_LEN + msg->len); -#endif free_msg_data(msg); reset_system_info(&sys_info); |