4 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
8 * Cherepanov Vitaliy <v.cherepanov@samsung.com>
9 * Nikita Kalyazin <n.kalyazin@samsung.com>
11 * Licensed under the Apache License, Version 2.0 (the "License");
12 * you may not use this file except in compliance with the License.
13 * You may obtain a copy of the License at
15 * http://www.apache.org/licenses/LICENSE-2.0
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
24 * - Samsung RnD Institute Russia
29 #ifndef _DAEMON_DEBUG_H_
30 #define _DAEMON_DEBUG_H_
32 #include <stdint.h> // for uint64_t, int64_t
33 #include <pthread.h> // for pthread_mutex_t
35 #include "da_protocol.h"
44 //#define DEB_PRINTBUF
45 //#define PARSE_DEBUG_ON
47 //#define THREAD_SAMPLING_DEBUG
48 //#define THREAD_REPLAY_DEBUG
53 #define parse_deb LOGI
55 #define parse_deb(...) do{}while(0)
59 #define printBuf(buf, len) print_buf(buf, len, __FUNCTION__)
60 void print_buf (char * buf, int len, const char *info);
62 //THREAD SAMPLING DEBUG
63 #ifdef THREAD_SAMPLING_DEBUG
64 #define LOGI_th_samp LOGI
66 #define LOGI_th_samp(...) do{} while(0)
70 #ifdef THREAD_REPLAY_DEBUG
71 #define LOGI_th_rep LOGI
73 #define LOGI_th_rep(...) do{} while(0)
83 #define LOGI(...) do{} while(0)
84 #define LOGI_(...) do{} while(0)
86 // #define LOGI(...) do{ fprintf(stderr, "[INF] (%s):", __FUNCTION__); fflush(stderr); fprintf(stderr, __VA_ARGS__ ); fflush(stderr); usleep(100000);} while(0)
87 #define LOGI(...) do{ fprintf(stderr, "[INF] (%s):", __FUNCTION__); fflush(stderr); fprintf(stderr, __VA_ARGS__ ); fflush(stderr); } while(0)
88 // #define LOGI(...) do{} while(0)
89 #define LOGI_(...) do{ fprintf(stderr, __VA_ARGS__ ); fflush(stderr); } while(0)
90 //#define LOGI_(...) do{} while(0)
93 // #define LOGE(...) do{ fprintf(stderr, "[ERR] (%s):", __FUNCTION__); fflush(stderr); fprintf(stderr, __VA_ARGS__ ); fflush(stderr); usleep(1000000);} while(0)
94 #define LOGE(...) do{ fprintf(stderr, "[ERR] (%s):", __FUNCTION__); fflush(stderr); fprintf(stderr, __VA_ARGS__ ); fflush(stderr); } while(0)
95 #define LOGW(...) do{ fprintf(stderr, "[WRN] (%s):", __FUNCTION__); fflush(stderr); fprintf(stderr, __VA_ARGS__ ); fflush(stderr); } while(0)
99 #define LOGI(...) do{} while(0)
100 #define LOGI_(...) do{} while(0)
101 #define LOGE(...) do{} while(0)
102 #define LOGW(...) do{} while(0)
111 #endif // _DAEMON_DEBUG_H_