+#define TBM_TRACE_BO(fmt, args...) \
+ do { \
+ if (trace_mask&TBM_BUFGMR_DEBUG_TRACE_BO) { \
+ struct timespec ts; \
+ clock_gettime(CLOCK_MONOTONIC, &ts); \
+ tbm_log_print(TBM_LOG_LEVEL_INFO, "[%5d.%06d][%d][%s %d](TRACE)"fmt, \
+ (int)ts.tv_sec, (int)ts.tv_nsec / 1000, \
+ (int)syscall(SYS_gettid), __FUNCTION__, __LINE__, ##args); \
+ } \
+ } while (0)
+
+#define TBM_TRACE_SURFACE_INTERNAL(fmt, args...) \
+ do { \
+ if (trace_mask&TBM_BUFGMR_DEBUG_TRACE_SURFACE_INTERNAL) { \
+ struct timespec ts; \
+ clock_gettime(CLOCK_MONOTONIC, &ts); \
+ tbm_log_print(TBM_LOG_LEVEL_INFO, "[%5d.%06d][%d][%s %d](TRACE)"fmt, \
+ (int)ts.tv_sec, (int)ts.tv_nsec / 1000, \
+ (int)syscall(SYS_gettid), __FUNCTION__, __LINE__, ##args); \
+ } \
+ } while (0)
+
+#define TBM_TRACE_SURFACE(fmt, args...) \
+ do { \
+ if (trace_mask&TBM_BUFGMR_DEBUG_TRACE_SURFACE) { \
+ struct timespec ts; \
+ clock_gettime(CLOCK_MONOTONIC, &ts); \
+ tbm_log_print(TBM_LOG_LEVEL_INFO, "[%5d.%06d][%d][%s %d](TRACE)"fmt, \
+ (int)ts.tv_sec, (int)ts.tv_nsec / 1000, \
+ (int)syscall(SYS_gettid), __FUNCTION__, __LINE__, ##args); \
+ } \
+ } while (0)
+
+#define TBM_TRACE_SURFACE_QUEUE(fmt, args...) \
+ do { \
+ if (trace_mask&TBM_BUFGMR_DEBUG_TRACE_SURFACE_QUEUE) { \
+ struct timespec ts; \
+ clock_gettime(CLOCK_MONOTONIC, &ts); \
+ tbm_log_print(TBM_LOG_LEVEL_INFO, "[%5d.%06d][%d][%s %d](TRACE)"fmt, \
+ (int)ts.tv_sec, (int)ts.tv_nsec / 1000, \
+ (int)syscall(SYS_gettid), __FUNCTION__, __LINE__, ##args); \
+ } \
+ } while (0)
+
+#define TBM_TRACE(fmt, args...) \
+ do { \
+ if (trace_mask&0x1) { \
+ struct timespec ts; \
+ clock_gettime(CLOCK_MONOTONIC, &ts); \
+ tbm_log_print(TBM_LOG_LEVEL_INFO, "[%5d.%06d][%d][%s %d](TRACE)"fmt, \
+ (int)ts.tv_sec, (int)ts.tv_nsec / 1000, \
+ (int)syscall(SYS_gettid), __FUNCTION__, __LINE__, ##args); \
+ } \
+ } while (0)
+
+