From: SooChan Lim Date: Wed, 23 Mar 2016 08:44:51 +0000 (+0900) Subject: change the log format of TBM_QUEUE_TRACE X-Git-Tag: accepted/tizen/common/20160414.142626~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cee099c870d10faf019ad9f61e8d10c824cc4702;p=platform%2Fcore%2Fuifw%2Flibtbm.git change the log format of TBM_QUEUE_TRACE Change-Id: I5f78e86683ff741d25bef012cd26f65ebde91f1d --- diff --git a/src/tbm_surface_queue.c b/src/tbm_surface_queue.c index 7210173..4f7be75 100755 --- a/src/tbm_surface_queue.c +++ b/src/tbm_surface_queue.c @@ -39,11 +39,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define DEBUG 0 #if DEBUG -#define TBM_QUEUE_TRACE() TBM_LOG("[QUEUE_TRACE] %s:%d surface_queue:%p\n", __func__, __LINE__, surface_queue) +#define TBM_QUEUE_TRACE(fmt, ...) fprintf(stderr, "[TBM(%d):%s] " fmt, getpid(), __func__, ##__VA_ARGS__) #define TBM_LOCK() TBM_LOG("[LOCK] %s:%d surface:%p\n", __func__, __LINE__, surface_queue) #define TBM_UNLOCK() TBM_LOG("[UNLOCK] %s:%d surface:%p\n", __func__, __LINE__, surface_queue) #else -#define TBM_QUEUE_TRACE() +#define TBM_QUEUE_TRACE(fmt, ...) #define TBM_LOCK() #define TBM_UNLOCK() #endif @@ -441,7 +441,7 @@ tbm_surface_queue_set_destroy_cb( pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); surface_queue->destroy_cb = destroy_cb; surface_queue->destroy_cb_data = data; @@ -461,7 +461,7 @@ tbm_surface_queue_add_destroy_cb( pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); _notify_add(&surface_queue->destory_noti, destroy_cb, data); @@ -480,7 +480,7 @@ tbm_surface_queue_remove_destroy_cb( pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); _notify_remove(&surface_queue->destory_noti, destroy_cb, data); @@ -499,7 +499,7 @@ tbm_surface_queue_set_dequeuable_cb( pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); surface_queue->dequeuable_cb = dequeuable_cb; surface_queue->dequeuable_cb_data = data; @@ -519,7 +519,7 @@ tbm_surface_queue_add_dequeuable_cb( pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); _notify_add(&surface_queue->dequeuable_noti, dequeuable_cb, data); @@ -538,7 +538,7 @@ tbm_surface_queue_remove_dequeuable_cb( pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); _notify_remove(&surface_queue->dequeuable_noti, dequeuable_cb, data); @@ -557,7 +557,7 @@ tbm_surface_queue_set_acquirable_cb( pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); surface_queue->acquirable_cb = acquirable_cb; surface_queue->acquirable_cb_data = data; @@ -577,7 +577,7 @@ tbm_surface_queue_add_acquirable_cb( pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); _notify_add(&surface_queue->acquirable_noti, acquirable_cb, data); @@ -596,7 +596,7 @@ tbm_surface_queue_remove_acquirable_cb( pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); _notify_remove(&surface_queue->acquirable_noti, acquirable_cb, data); @@ -617,7 +617,7 @@ tbm_surface_queue_set_alloc_cb( pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); surface_queue->alloc_cb = alloc_cb; surface_queue->free_cb = free_cb; @@ -633,7 +633,7 @@ tbm_surface_queue_get_width(tbm_surface_queue_h surface_queue) { TBM_RETURN_VAL_IF_FAIL(surface_queue != NULL, 0); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); TBM_RETURN_VAL_IF_FAIL(surface_queue != NULL, 0); @@ -645,7 +645,7 @@ tbm_surface_queue_get_height(tbm_surface_queue_h surface_queue) { TBM_RETURN_VAL_IF_FAIL(surface_queue != NULL, 0); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); return surface_queue->height; } @@ -655,7 +655,7 @@ tbm_surface_queue_get_format(tbm_surface_queue_h surface_queue) { TBM_RETURN_VAL_IF_FAIL(surface_queue != NULL, 0); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); return surface_queue->format; } @@ -665,7 +665,7 @@ tbm_surface_queue_get_size(tbm_surface_queue_h surface_queue) { TBM_RETURN_VAL_IF_FAIL(surface_queue != NULL, 0); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); return surface_queue->queue_size; } @@ -680,7 +680,7 @@ tbm_surface_queue_set_reset_cb( pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); surface_queue->reset_cb = reset_cb; surface_queue->reset_cb_data = data; @@ -700,7 +700,7 @@ tbm_surface_queue_add_reset_cb( pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); _notify_add(&surface_queue->acquirable_noti, reset_cb, data); @@ -719,7 +719,7 @@ tbm_surface_queue_remove_reset_cb( pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); _notify_remove(&surface_queue->acquirable_noti, reset_cb, data); @@ -742,7 +742,7 @@ tbm_surface_queue_enqueue(tbm_surface_queue_h pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p) tbm_surface(%p)\n", surface_queue, surface); node = _queue_get_node(surface_queue, 0, surface, &queue_type); if (node == NULL || queue_type != NODE_LIST) { @@ -785,8 +785,6 @@ tbm_surface_queue_dequeue(tbm_surface_queue_h pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); - if (surface_queue->impl && surface_queue->impl->dequeue) node = surface_queue->impl->dequeue(surface_queue); else @@ -807,6 +805,8 @@ tbm_surface_queue_dequeue(tbm_surface_queue_h *surface = node->surface; + TBM_QUEUE_TRACE("tbm_surface_queue(%p) tbm_surface(%p)\n", surface_queue, *surface); + pthread_mutex_unlock(&surface_queue->lock); return TBM_SURFACE_QUEUE_ERROR_NONE; @@ -819,7 +819,7 @@ tbm_surface_queue_can_dequeue(tbm_surface_queue_h surface_queue, int wait) pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); if (_queue_is_empty(&surface_queue->free_queue)) { if (surface_queue->impl && surface_queue->impl->need_attach) @@ -856,7 +856,7 @@ tbm_surface_queue_release(tbm_surface_queue_h pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p) tbm_surface(%p)\n", surface_queue, surface); node = _queue_get_node(surface_queue, 0, surface, &queue_type); if (node == NULL || queue_type != NODE_LIST) { @@ -899,8 +899,6 @@ tbm_surface_queue_acquire(tbm_surface_queue_h pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); - if (surface_queue->impl && surface_queue->impl->acquire) node = surface_queue->impl->acquire(surface_queue); else @@ -921,6 +919,8 @@ tbm_surface_queue_acquire(tbm_surface_queue_h *surface = node->surface; + TBM_QUEUE_TRACE("tbm_surface_queue(%p) tbm_surface(%p)\n", surface_queue, *surface); + pthread_mutex_unlock(&surface_queue->lock); return TBM_SURFACE_QUEUE_ERROR_NONE; @@ -933,7 +933,7 @@ tbm_surface_queue_can_acquire(tbm_surface_queue_h surface_queue, int wait) pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); if (_queue_is_empty(&surface_queue->dirty_queue)) { if (wait) { @@ -958,7 +958,7 @@ tbm_surface_queue_destroy(tbm_surface_queue_h surface_queue) TBM_RETURN_IF_FAIL(surface_queue != NULL); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); if (surface_queue->destroy_cb) surface_queue->destroy_cb(surface_queue, surface_queue->destroy_cb_data); @@ -988,7 +988,7 @@ tbm_surface_queue_reset(tbm_surface_queue_h TBM_RETURN_VAL_IF_FAIL(surface_queue != NULL, TBM_SURFACE_QUEUE_ERROR_INVALID_QUEUE); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); queue_node *node = NULL, *tmp = NULL; @@ -1035,7 +1035,7 @@ tbm_surface_queue_flush(tbm_surface_queue_h surface_queue) pthread_mutex_lock(&surface_queue->lock); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); /* Destory surface and Push to free_queue */ LIST_FOR_EACH_ENTRY_SAFE(node, tmp, &surface_queue->list, link) { @@ -1138,7 +1138,7 @@ tbm_surface_queue_create(int queue_size, int width, sizeof(struct _tbm_surface_queue)); TBM_RETURN_VAL_IF_FAIL(surface_queue != NULL, NULL); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); tbm_queue_default *data = (tbm_queue_default *) calloc(1, sizeof(tbm_queue_default)); @@ -1272,7 +1272,7 @@ tbm_surface_queue_sequence_create(int queue_size, int width, sizeof(struct _tbm_surface_queue)); TBM_RETURN_VAL_IF_FAIL(surface_queue != NULL, NULL); - TBM_QUEUE_TRACE(); + TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue); tbm_queue_sequence *data = (tbm_queue_sequence *) calloc(1, sizeof(tbm_queue_sequence));