remove WL_TBM keyword and new line characters when using dlog 70/141370/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 31 Jul 2017 06:10:46 +0000 (15:10 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Mon, 31 Jul 2017 06:33:38 +0000 (15:33 +0900)
Change-Id: I5be9fee4828e5c5d844ac0271eca3e91678305a7

src/wayland-tbm-client.c
src/wayland-tbm-int.h
src/wayland-tbm-server.c
src/wayland-tbm-util.c

index 56a3529..9c8320f 100644 (file)
@@ -156,7 +156,7 @@ handle_tbm_buffer_import_with_id(void *data,
        tbm_surface_internal_set_debug_data(tbm_surface, "id", debug_id);
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("pid:%d wl_buffer:%p tbm_surface:%p\n", getpid(), wl_buffer, tbm_surface);
+       WL_TBM_TRACE("pid:%d wl_buffer:%p tbm_surface:%p", getpid(), wl_buffer, tbm_surface);
 #endif
 
        return;
@@ -205,7 +205,7 @@ handle_tbm_buffer_import_with_fd(void *data,
        tbm_surface_internal_set_debug_data(tbm_surface, "id", debug_id);
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("pid:%d wl_buffer:%p tbm_surface:%p\n", getpid(), wl_buffer, tbm_surface);
+       WL_TBM_TRACE("pid:%d wl_buffer:%p tbm_surface:%p", getpid(), wl_buffer, tbm_surface);
 #endif
 
        return;
@@ -327,7 +327,7 @@ handle_tbm_monitor_client_request_to_client(void *data, struct wl_tbm_monitor *w
        }
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("receive request_id:%s argc:%d [%s %s] options:'%s'\n", request_id, argc, argv[0], argv[1], temp);
+       WL_TBM_TRACE("receive request_id:%s argc:%d [%s %s] options:'%s'", request_id, argc, argv[0], argv[1], temp);
 #endif
 
        if (argc > 0) {
@@ -366,7 +366,7 @@ _wayland_tbm_client_registry_handle_global(void *data,
                if (!tbm_client->bufmgr) {
                        tbm_client->bufmgr = tbm_bufmgr_init(-1);
                        if (!tbm_client->bufmgr) {
-                               WL_TBM_LOG("failed to get auth_info\n");
+                               WL_TBM_LOG("failed to get auth_info");
                                wl_tbm_destroy(tbm_client->wl_tbm);
                                tbm_client->wl_tbm = NULL;
                                return;
@@ -423,14 +423,14 @@ wayland_tbm_client_init(struct wl_display *display)
 
        display_wrapper = wl_proxy_create_wrapper(display);
        if (!display_wrapper) {
-               WL_TBM_LOG("Failed to create display_wrapper.\n");
+               WL_TBM_LOG("Failed to create display_wrapper.");
                free(tbm_client);
                return NULL;
        }
 
        wl_queue = wl_display_create_queue(display);
        if (!wl_queue) {
-               WL_TBM_LOG("Failed to create queue.\n");
+               WL_TBM_LOG("Failed to create queue.");
                wl_proxy_wrapper_destroy(display_wrapper);
                free(tbm_client);
                return NULL;
@@ -441,7 +441,7 @@ wayland_tbm_client_init(struct wl_display *display)
        wl_registry = wl_display_get_registry(display_wrapper);
        wl_proxy_wrapper_destroy(display_wrapper);
        if (!wl_registry) {
-               WL_TBM_LOG("Failed to get registry\n");
+               WL_TBM_LOG("Failed to get registry");
 
                wl_event_queue_destroy(wl_queue);
                free(tbm_client);
@@ -450,7 +450,7 @@ wayland_tbm_client_init(struct wl_display *display)
 
        wl_registry_add_listener(wl_registry, &registry_listener, tbm_client);
        if (wl_display_roundtrip_queue(display, wl_queue) < 0) {
-               WL_TBM_LOG("Failed to wl_display_roundtrip_queuey\n");
+               WL_TBM_LOG("Failed to wl_display_roundtrip_queue");
 
                wl_registry_destroy(wl_registry);
                wl_event_queue_destroy(wl_queue);
@@ -463,7 +463,7 @@ wayland_tbm_client_init(struct wl_display *display)
 
        /* check wl_tbm */
        if (!tbm_client->wl_tbm) {
-               WL_TBM_LOG("failed to create wl_tbm\n");
+               WL_TBM_LOG("failed to create wl_tbm");
                wayland_tbm_client_deinit(tbm_client);
                return NULL;
        }
@@ -571,25 +571,25 @@ wayland_tbm_client_create_buffer(struct wayland_tbm_client *tbm_client,
                return buffer->wl_buffer;
 
        if (tbm_surface_get_info(surface, &info) != TBM_SURFACE_ERROR_NONE) {
-               WL_TBM_LOG("Failed to create buffer from surface\n");
+               WL_TBM_LOG("Failed to create buffer from surface");
                return NULL;
        }
 
        if (info.num_planes > 3) {
-               WL_TBM_LOG("invalid num_planes(%d)\n", info.num_planes);
+               WL_TBM_LOG("invalid num_planes(%d)", info.num_planes);
                return NULL;
        }
 
        num_buf = tbm_surface_internal_get_num_bos(surface);
        if (num_buf == 0) {
-               WL_TBM_LOG("surface doesn't have any bo.\n");
+               WL_TBM_LOG("surface doesn't have any bo.");
                return NULL;
        }
 
        for (i = 0; i < num_buf; i++) {
                tbm_bo bo = tbm_surface_internal_get_bo(surface, i);
                if (bo == NULL) {
-                       WL_TBM_LOG("Failed to get bo from surface\n");
+                       WL_TBM_LOG("Failed to get bo from surface");
                        goto err;
                }
 
@@ -610,7 +610,7 @@ wayland_tbm_client_create_buffer(struct wayland_tbm_client *tbm_client,
                if (is_fd == -1 ||
                    (is_fd == 1 && bufs[i] < 0) ||
                    (is_fd == 0 && bufs[i] <= 0)) {
-                       WL_TBM_LOG("Failed to export(is_fd:%d, bufs:%d)\n", is_fd, bufs[i]);
+                       WL_TBM_LOG("Failed to export(is_fd:%d, bufs:%d)", is_fd, bufs[i]);
                        goto err;
                }
        }
@@ -651,7 +651,7 @@ wayland_tbm_client_create_buffer(struct wayland_tbm_client *tbm_client,
        wl_array_release(&plane_size);
 
        if (!wl_buffer) {
-               WL_TBM_LOG("Failed to create wl_buffer\n");
+               WL_TBM_LOG("Failed to create wl_buffer");
                goto err;
        }
 
@@ -667,7 +667,7 @@ wayland_tbm_client_create_buffer(struct wayland_tbm_client *tbm_client,
        tbm_surface_internal_set_debug_data(surface, "id", debug_id);
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("        pid:%d wl_buffer:%p tbm_surface:%p\n", getpid(),
+       WL_TBM_TRACE("        pid:%d wl_buffer:%p tbm_surface:%p", getpid(),
                        wl_buffer, surface);
 #endif
 
@@ -694,7 +694,7 @@ wayland_tbm_client_destroy_buffer(struct wayland_tbm_client *tbm_client,
        // TODO: valid check if the buffer is from this tbm_client???
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("       pid:%d wl_buffer:%p\n", getpid(), wl_buffer);
+       WL_TBM_TRACE("       pid:%d wl_buffer:%p", getpid(), wl_buffer);
 #endif
 
        buffer = _wayland_tbm_client_find_tbm_buffer_wl_buffer(tbm_client, wl_buffer);
@@ -741,14 +741,14 @@ _wayland_tbm_client_queue_destroy_attach_bufs(struct wayland_tbm_surface_queue *
 
        wl_list_for_each_safe(buffer, tmp, &queue_info->attach_bufs, link) {
 #ifdef DEBUG_TRACE
-               WL_TBM_TRACE("pid:%d wl_buffer:%p tbm_surface:%p\n", getpid(), buffer->wl_buffer, buffer->tbm_surface);
+               WL_TBM_TRACE("pid:%d wl_buffer:%p tbm_surface:%p", getpid(), buffer->wl_buffer, buffer->tbm_surface);
 #endif
                if (buffer->wl_buffer) {
                        wl_tbm_queue_detach_buffer(queue_info->wl_tbm_queue, buffer->wl_buffer);
 
                        if (!buffer->reuse) {
 #ifdef DEBUG_TRACE
-                               WL_TBM_TRACE("destroy the wl_buffer:%p\n", buffer->wl_buffer);
+                               WL_TBM_TRACE("destroy the wl_buffer:%p", buffer->wl_buffer);
 #endif
                                wl_buffer_destroy(buffer->wl_buffer);
                                buffer->wl_buffer = NULL;
@@ -769,14 +769,14 @@ _wayland_tbm_client_queue_destroy_unused_attach_bufs(struct wayland_tbm_surface_
        wl_list_for_each_safe(buffer, tmp, &queue_info->attach_bufs, link) {
                if (buffer->allocated) continue;
 #ifdef DEBUG_TRACE
-               WL_TBM_TRACE("pid:%d wl_buffer:%p tbm_surface:%p\n", getpid(), buffer->wl_buffer, buffer->tbm_surface);
+               WL_TBM_TRACE("pid:%d wl_buffer:%p tbm_surface:%p", getpid(), buffer->wl_buffer, buffer->tbm_surface);
 #endif
                if (buffer->wl_buffer) {
                        wl_tbm_queue_detach_buffer(queue_info->wl_tbm_queue, buffer->wl_buffer);
 
                        if (!buffer->reuse) {
 #ifdef DEBUG_TRACE
-                               WL_TBM_TRACE("destroy the wl_buffer:%p\n", buffer->wl_buffer);
+                               WL_TBM_TRACE("destroy the wl_buffer:%p", buffer->wl_buffer);
 #endif
                                wl_buffer_destroy(buffer->wl_buffer);
                                buffer->wl_buffer = NULL;
@@ -793,7 +793,7 @@ static void
 _wayland_tbm_client_surface_queue_flush(struct wayland_tbm_surface_queue *queue_info)
 {
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("pid:%d\n", getpid());
+       WL_TBM_TRACE("pid:%d", getpid());
 #endif
 
        _wayland_tbm_client_queue_destroy_unused_attach_bufs(queue_info);
@@ -894,7 +894,7 @@ __wayland_tbm_client_surface_alloc_cb(tbm_surface_queue_h surface_queue, void *d
                                buffer->allocated = 1;
 
 #ifdef DEBUG_TRACE
-                               WL_TBM_TRACE("   pid:%d wl_buffer:%p tbm_surface:%p ACTIVE\n", getpid(), buffer->wl_buffer, buffer->tbm_surface);
+                               WL_TBM_TRACE("   pid:%d wl_buffer:%p tbm_surface:%p ACTIVE", getpid(), buffer->wl_buffer, buffer->tbm_surface);
 #endif
                                break;
                        }
@@ -912,7 +912,7 @@ __wayland_tbm_client_surface_alloc_cb(tbm_surface_queue_h surface_queue, void *d
                                                        queue_info->flag);
 
 #ifdef DEBUG_TRACE
-               WL_TBM_TRACE("   pid:%d tbm_surface:%p DEACTIVE\n", getpid(), surface);
+               WL_TBM_TRACE("   pid:%d tbm_surface:%p DEACTIVE", getpid(), surface);
 #endif
        }
 
@@ -924,7 +924,7 @@ __wayland_tbm_client_surface_free_cb(tbm_surface_queue_h surface_queue, void *da
                      tbm_surface_h surface)
 {
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("    pid:%d tbm_surface:%p\n", getpid(), surface);
+       WL_TBM_TRACE("    pid:%d tbm_surface:%p", getpid(), surface);
 #endif
        struct wayland_tbm_surface_queue *queue_info =
                                (struct wayland_tbm_surface_queue *)data;
@@ -991,7 +991,7 @@ handle_tbm_queue_buffer_attached(void *data,
        }
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("pid:%d wl_buffer:%p tbm_surface:%p\n",
+       WL_TBM_TRACE("pid:%d wl_buffer:%p tbm_surface:%p",
                        getpid(), buffer->wl_buffer, buffer->tbm_surface);
 #endif
 
@@ -1013,14 +1013,14 @@ handle_tbm_queue_active(void *data,
        struct wayland_tbm_surface_queue *queue_info =
                                (struct wayland_tbm_surface_queue *)data;
 
-       WL_TBM_LOG("active queue\n");
+       WL_TBM_LOG("active queue");
 
        if (queue_info->is_active) {
-               WL_TBM_C_LOG("warning: queue_info is already activated\n");
+               WL_TBM_C_LOG("warning: queue_info is already activated");
                return;
        }
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("                  pid:%d\n", getpid());
+       WL_TBM_TRACE("                  pid:%d", getpid());
 #endif
 
        if (need_flush) {
@@ -1041,13 +1041,13 @@ handle_tbm_queue_deactive(void *data,
                                (struct wayland_tbm_surface_queue *)data;
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("                  pid:%d\n", getpid());
+       WL_TBM_TRACE("                  pid:%d", getpid());
 #endif
 
-       WL_TBM_LOG("deactive queue\n");
+       WL_TBM_LOG("deactive queue");
 
        if (!queue_info->is_active) {
-               WL_TBM_C_LOG("warning: queue_info is already deactivated\n");
+               WL_TBM_C_LOG("warning: queue_info is already deactivated");
                return;
        }
 
@@ -1068,12 +1068,12 @@ handle_tbm_queue_flush(void *data,
                                (struct wayland_tbm_surface_queue *)data;
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("pid:%d\n", getpid());
+       WL_TBM_TRACE("pid:%d", getpid());
 #endif
-       WL_TBM_LOG("flush queue\n");
+       WL_TBM_LOG("flush queue");
 
        if (queue_info->is_active && queue_info->active_flush) {
-               WL_TBM_C_LOG("warning: Cannot flush the tbm_surface_queueu. The queue is activate.\n");
+               WL_TBM_C_LOG("warning: Cannot flush the tbm_surface_queueu. The queue is activate.");
                return;
        }
 
@@ -1131,7 +1131,7 @@ _handle_tbm_surface_queue_destroy_notify(tbm_surface_queue_h surface_queue,
                                (struct wayland_tbm_surface_queue *)data;
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE(" pid:%d\n", getpid());
+       WL_TBM_TRACE(" pid:%d", getpid());
 #endif
 
        /* remove the attach_bufs int the queue_info */
@@ -1154,7 +1154,7 @@ _handle_tbm_surface_queue_reset_notify(tbm_surface_queue_h surface_queue,
        int format;
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE(" pid:%d\n", getpid());
+       WL_TBM_TRACE(" pid:%d", getpid());
 #endif
 
        width = tbm_surface_queue_get_width(surface_queue);
@@ -1195,14 +1195,14 @@ _handle_tbm_surface_queue_can_dequeue_notify(tbm_surface_queue_h surface_queue,
        if (wl_display_roundtrip_queue(tbm_client->dpy, tbm_client->event_queue) == -1) {
                int dpy_err;
 
-               WL_TBM_LOG_E("failed to wl_display_roundtrip_queue errno:%d\n", errno);
+               WL_TBM_LOG_E("failed to wl_display_roundtrip_queue errno:%d", errno);
 
                dpy_err = wl_display_get_error(tbm_client->dpy);
                if (dpy_err == EPROTO) {
                        const struct wl_interface *interface;
                        uint32_t proxy_id, code;
                        code = wl_display_get_protocol_error(tbm_client->dpy, &interface, &proxy_id);
-                       WL_TBM_LOG_E("protocol error interface:%s code:%d proxy_id:%d \n",
+                       WL_TBM_LOG_E("protocol error interface:%s code:%d proxy_id:%d",
                                                 interface->name, code, proxy_id);
                }
        }
@@ -1241,7 +1241,7 @@ wayland_tbm_client_create_surface_queue(struct wayland_tbm_client *tbm_client,
        struct wl_tbm_queue *queue;
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE(" pid:%d\n", getpid());
+       WL_TBM_TRACE(" pid:%d", getpid());
 #endif
 
        WL_TBM_RETURN_VAL_IF_FAIL(tbm_client != NULL, NULL);
@@ -1291,7 +1291,7 @@ wayland_tbm_client_create_surface_queue(struct wayland_tbm_client *tbm_client,
                                        _handle_tbm_surface_queue_trace_notify, queue_info);
 
 #ifdef DEBUG_TRACE
-       WL_TBM_C_LOG("INFO cur(%dx%d fmt:0x%x num:%d) new(%dx%d fmt:0x%x num:%d)\n",
+       WL_TBM_C_LOG("INFO cur(%dx%d fmt:0x%x num:%d) new(%dx%d fmt:0x%x num:%d)",
                queue_info->width, queue_info->height,
                queue_info->format, queue_info->num_bufs,
                width, height, format, queue_size);
index 900f52a..601acc3 100644 (file)
@@ -52,63 +52,63 @@ extern int bTrace;
 
 #define WL_TBM_C_LOG(fmt, ...) {\
        if (bDlog) {\
-               LOGE("[WL_TBM_C] " fmt, ##__VA_ARGS__);\
+               LOGE(fmt, ##__VA_ARGS__);\
        } \
        else {\
-               fprintf(stderr, "[WL_TBM_C(%d):%s] " fmt, getpid(), __func__, ##__VA_ARGS__);\
+               fprintf(stderr, "[WL_TBM_C(%d):%s] " fmt"\n", getpid(), __func__, ##__VA_ARGS__);\
        } \
 }
 #define WL_TBM_S_LOG(fmt, ...) {\
        if (bDlog) {\
-               LOGI("[WL_TBM_S] " fmt, ##__VA_ARGS__);\
+               LOGI(fmt, ##__VA_ARGS__);\
        } \
        else{\
-               fprintf(stderr, "[WL_TBM_S(%d):%s] " fmt, getpid(), __func__, ##__VA_ARGS__);\
+               fprintf(stderr, "[WL_TBM_S(%d):%s] " fmt"\n", getpid(), __func__, ##__VA_ARGS__);\
        } \
 }
 #define WL_TBM_LOG(fmt, ...) {\
        if (bDlog) {\
-               LOGI("[WL_TBM] " fmt, ##__VA_ARGS__);\
+               LOGI(fmt, ##__VA_ARGS__);\
        } \
        else {\
-               fprintf(stderr, "[WL_TBM(%d)] " fmt, getpid(), ##__VA_ARGS__);\
+               fprintf(stderr, "[WL_TBM(%d)] " fmt"\n", getpid(), ##__VA_ARGS__);\
        } \
 }
 
 /* temp log */
 #define WL_TBM_LOG_E(fmt, ...) {\
        if (bDlog) {\
-               LOGE("[WL_TBM] " fmt, ##__VA_ARGS__);\
+               LOGE(fmt, ##__VA_ARGS__);\
        } \
        else {\
-               fprintf(stderr, "[WL_TBM(%d)] " fmt, getpid(), ##__VA_ARGS__);\
+               fprintf(stderr, "[WL_TBM(%d)] " fmt"\n", getpid(), ##__VA_ARGS__);\
        } \
 }
 
 #else
-#define WL_TBM_C_LOG(fmt, ...)   fprintf(stderr, "[WL_TBM_C(%d):%s] " fmt, getpid(), __func__, ##__VA_ARGS__)
-#define WL_TBM_S_LOG(fmt, ...)   fprintf(stderr, "[WL_TBM_S(%d):%s] " fmt, getpid(), __func__, ##__VA_ARGS__)
-#define WL_TBM_LOG(fmt, ...)     fprintf(stderr, "[WL_TBM(%d)] " fmt, getpid(), ##__VA_ARGS__)
-#define WL_TBM_LOG_E(fmt, ...)   fprintf(stderr, "[WL_TBM_E(%d)] " fmt, getpid(), ##__VA_ARGS__)
+#define WL_TBM_C_LOG(fmt, ...)   fprintf(stderr, "[WL_TBM_C(%d):%s] " fmt"\n", getpid(), __func__, ##__VA_ARGS__)
+#define WL_TBM_S_LOG(fmt, ...)   fprintf(stderr, "[WL_TBM_S(%d):%s] " fmt"\n", getpid(), __func__, ##__VA_ARGS__)
+#define WL_TBM_LOG(fmt, ...)     fprintf(stderr, "[WL_TBM(%d)] " fmt"\n", getpid(), ##__VA_ARGS__)
+#define WL_TBM_LOG_E(fmt, ...)   fprintf(stderr, "[WL_TBM_E(%d)] " fmt"\n", getpid(), ##__VA_ARGS__)
 #endif /* ENABLE_DLOG */
 
 
 /* check condition */
 #define WL_TBM_RETURN_IF_FAIL(cond) {\
        if (!(cond)) {\
-               WL_TBM_LOG("'%s' failed.\n", #cond);\
+               WL_TBM_LOG("'%s' failed.", #cond);\
                return;\
        } \
 }
 #define WL_TBM_RETURN_VAL_IF_FAIL(cond, val) {\
        if (!(cond)) {\
-               WL_TBM_LOG("'%s' failed.\n", #cond);\
+               WL_TBM_LOG("'%s' failed.", #cond);\
                return val;\
        } \
 }
 #define WL_TBM_GOTO_IF_FAIL(cond, dst) {\
        if (!(cond)) {\
-               WL_TBM_LOG("'%s' failed.\n", #cond);\
+               WL_TBM_LOG("'%s' failed.", #cond);\
                goto dst;\
        } \
 }
index b471208..f800ac6 100644 (file)
@@ -112,7 +112,7 @@ _wayland_tbm_server_free_user_data(void *user_data)
 
                wl_list_for_each_safe(pos, tmp, &ud->wayland_tbm_buffer_list,
                                                                link_ref) {
-                       WL_TBM_S_LOG("Error: wl_buffer(%p) still alive tbm_surface:%p\n",
+                       WL_TBM_S_LOG("Error: wl_buffer(%p) still alive tbm_surface:%p",
                                                pos->wl_buffer, pos->surface);
 
                        pos->surface = NULL;
@@ -138,7 +138,7 @@ _wayland_tbm_server_get_user_data(tbm_surface_h tbm_surface)
                if (!tbm_surface_internal_add_user_data(tbm_surface,
                                        (unsigned long)&key_ud,
                                        _wayland_tbm_server_free_user_data)) {
-                       WL_TBM_S_LOG("Fail to create user data for surface %p\n",
+                       WL_TBM_S_LOG("Fail to create user data for surface %p",
                                        tbm_surface);
                        goto out;
                }
@@ -146,7 +146,7 @@ _wayland_tbm_server_get_user_data(tbm_surface_h tbm_surface)
                if (!tbm_surface_internal_set_user_data(tbm_surface,
                                                        (unsigned long)&key_ud,
                                                        (void*)ud)) {
-                       WL_TBM_S_LOG("Fail to set user data for surface %p\n",
+                       WL_TBM_S_LOG("Fail to set user data for surface %p",
                                        tbm_surface);
                        goto out;
                }
@@ -168,7 +168,7 @@ _wayland_tbm_server_tbm_buffer_impl_destroy(struct wl_client *client, struct wl_
        pid_t pid;
 
        wl_client_get_credentials(client, &pid, NULL, NULL);
-       WL_TBM_TRACE("   pid:%d wl_buffer destoroy.\n", pid);
+       WL_TBM_TRACE("   pid:%d wl_buffer destoroy.", pid);
 #endif
 
        wl_resource_destroy(wl_buffer);
@@ -190,7 +190,7 @@ _wayland_tbm_server_buffer_destory(struct wl_resource *wl_buffer)
 
        if (tbm_buffer->client)
                wl_client_get_credentials(tbm_buffer->client, &pid, NULL, NULL);
-       WL_TBM_TRACE("            pid:%d tbm_surface:%p\n", pid, tbm_buffer->surface);
+       WL_TBM_TRACE("            pid:%d tbm_surface:%p", pid, tbm_buffer->surface);
 #endif
 
        if (tbm_buffer->destroy_cb)
@@ -225,7 +225,7 @@ _wayland_tbm_server_tbm_buffer_create(struct wl_resource *wl_tbm,
 
        tbm_buffer = calloc(1, sizeof(*tbm_buffer));
        if (tbm_buffer == NULL) {
-               WL_TBM_S_LOG("Error. fail to allocate a tbm_buffer.\n");
+               WL_TBM_S_LOG("Error. fail to allocate a tbm_buffer.");
                return NULL;
        }
        wl_list_init(&tbm_buffer->link_ref);
@@ -235,7 +235,7 @@ _wayland_tbm_server_tbm_buffer_create(struct wl_resource *wl_tbm,
        /* create a wl_buffer resource */
        tbm_buffer->wl_buffer = wl_resource_create(wl_client, &wl_buffer_interface, 1, id);
        if (!tbm_buffer->wl_buffer) {
-               WL_TBM_S_LOG("Error. fail to create wl_buffer resource.\n");
+               WL_TBM_S_LOG("Error. fail to create wl_buffer resource.");
                free(tbm_buffer);
                return NULL;
        }
@@ -331,7 +331,7 @@ _wayland_tbm_server_impl_create_buffer(struct wl_client *client,
        pid_t pid;
 
        wl_client_get_credentials(client, &pid, NULL, NULL);
-       WL_TBM_TRACE("pid:%d tbm_surface:%p\n", pid, surface);
+       WL_TBM_TRACE("pid:%d tbm_surface:%p", pid, surface);
 #endif
 }
 
@@ -406,7 +406,7 @@ _wayland_tbm_server_impl_create_buffer_with_fd(struct wl_client *client,
        pid_t pid;
 
        wl_client_get_credentials(client, &pid, NULL, NULL);
-       WL_TBM_TRACE("pid:%d tbm_surface:%p\n", pid, surface);
+       WL_TBM_TRACE("pid:%d tbm_surface:%p", pid, surface);
 #endif
 
 done:
@@ -423,7 +423,7 @@ _wayland_tbm_server_queue_impl_destroy(struct wl_client *client,
        pid_t pid;
 
        wl_client_get_credentials(client, &pid, NULL, NULL);
-       WL_TBM_TRACE("wl_tbm_queue destory. pid:%d\n", pid);
+       WL_TBM_TRACE("wl_tbm_queue destory. pid:%d", pid);
 #endif
 
        wl_resource_destroy(wl_tbm_queue);
@@ -446,7 +446,7 @@ _wayland_tbm_server_queue_impl_detach_buffer(struct wl_client *client,
        pid_t pid;
 
        wl_client_get_credentials(client, &pid, NULL, NULL);
-       WL_TBM_TRACE("detach buffer. pid:%d\n", pid);
+       WL_TBM_TRACE("detach buffer. pid:%d", pid);
 #endif
 
        if (tbm_buffer->detach_cb)
@@ -465,7 +465,7 @@ _wayland_tbm_server_queue_impl_dequeue_buffer(struct wl_client *client,
        pid_t pid;
 
        wl_client_get_credentials(client, &pid, NULL, NULL);
-       WL_TBM_TRACE("dequeue buffer. pid:%d\n", pid);
+       WL_TBM_TRACE("dequeue buffer. pid:%d", pid);
 #endif
 
        cqueue = wl_resource_get_user_data(wl_tbm_queue);
@@ -492,7 +492,7 @@ _wayland_tbm_server_surface_queue_destroy(struct wl_resource *wl_tbm_queue)
 
        if (cqueue) {
 #ifdef DEBUG_TRACE
-               WL_TBM_TRACE("destory queue. pid:%d\n", cqueue->pid);
+               WL_TBM_TRACE("destory queue. pid:%d", cqueue->pid);
 #endif
                wl_list_remove(&cqueue->link);
                free(cqueue);
@@ -540,7 +540,7 @@ _wayland_tbm_server_impl_create_surface_queue(struct wl_client *client,
        wl_list_insert(&tbm_srv->cqueue_list, &cqueue->link);
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE(" pid:%d \n", pid);
+       WL_TBM_TRACE(" pid:%d ", pid);
 #endif
 }
 
@@ -613,7 +613,7 @@ _wayland_tbm_server_destroy_resource(struct wl_resource *wl_tbm)
 
        wl_client_get_credentials(wl_resource_get_client(wl_tbm), &pid, NULL,
                                                                        NULL);
-       WL_TBM_S_LOG("wl_tbm_monitor destroy. client=%d\n", pid);
+       WL_TBM_S_LOG("wl_tbm_monitor destroy. client=%d", pid);
 #endif
 
        /* remove the client resources to the list */
@@ -652,7 +652,7 @@ _wayland_tbm_server_bind_cb(struct wl_client *client, void *data,
        pid_t pid;
 
        wl_client_get_credentials(client, &pid, NULL, NULL);
-       WL_TBM_S_LOG("wl_tbm bind. client=%d\n", pid);
+       WL_TBM_S_LOG("wl_tbm bind. client=%d", pid);
 #endif
 }
 
@@ -771,18 +771,18 @@ _wayland_tbm_server_export_surface(struct wl_resource *wl_tbm,
        int *p;
 
        if (tbm_surface_get_info(surface, &info) != TBM_SURFACE_ERROR_NONE) {
-               WL_TBM_S_LOG("Failed to create buffer from surface\n");
+               WL_TBM_S_LOG("Failed to create buffer from surface");
                return 0;
        }
 
        if (info.num_planes > 3) {
-               WL_TBM_S_LOG("invalid num_planes(%d)\n", info.num_planes);
+               WL_TBM_S_LOG("invalid num_planes(%d)", info.num_planes);
                return 0;
        }
 
        num_buf = tbm_surface_internal_get_num_bos(surface);
        if (num_buf == 0) {
-               WL_TBM_S_LOG("surface doesn't have any bo.\n");
+               WL_TBM_S_LOG("surface doesn't have any bo.");
                return 0;
        }
 
@@ -810,7 +810,7 @@ _wayland_tbm_server_export_surface(struct wl_resource *wl_tbm,
                if (is_fd == -1 ||
                    (is_fd == 1 && bufs[i] < 0) ||
                    (is_fd == 0 && bufs[i] <= 0)) {
-                       WL_TBM_S_LOG("Failed to export(is_fd:%d, bufs:%d)\n", is_fd, bufs[i]);
+                       WL_TBM_S_LOG("Failed to export(is_fd:%d, bufs:%d)", is_fd, bufs[i]);
                        goto err;
                }
        }
@@ -891,7 +891,7 @@ wayland_tbm_server_export_buffer(struct wayland_tbm_server *tbm_srv,
        if (!_wayland_tbm_server_export_surface(wl_tbm,
                                                tbm_buffer->wl_buffer,
                                                surface)) {
-               WL_TBM_S_LOG("Failed to send the surface to the wl_tbm_queue\n");
+               WL_TBM_S_LOG("Failed to send the surface to the wl_tbm_queue");
                wl_resource_destroy(tbm_buffer->wl_buffer);
                tbm_surface_internal_unref(surface);
                return NULL;
@@ -953,9 +953,9 @@ wayland_tbm_server_client_queue_activate(struct wayland_tbm_client_queue *cqueue
        WL_TBM_RETURN_IF_FAIL(cqueue->wl_tbm_queue != NULL);
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("      pid:%d\n", cqueue->pid);
+       WL_TBM_TRACE("      pid:%d", cqueue->pid);
 #endif
-       WL_TBM_LOG("send active queue pid:%d\n", cqueue->pid);
+       WL_TBM_LOG("send active queue pid:%d", cqueue->pid);
 
        wl_tbm_queue_send_active(cqueue->wl_tbm_queue, usage, queue_size, need_flush);
 
@@ -973,7 +973,7 @@ wayland_tbm_server_client_queue_deactivate(struct wayland_tbm_client_queue *cque
        WL_TBM_RETURN_IF_FAIL(cqueue->wl_tbm_queue != NULL);
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("    pid:%d\n", cqueue->pid);
+       WL_TBM_TRACE("    pid:%d", cqueue->pid);
 #endif
        WL_TBM_LOG("send deactive queue pid:%d", cqueue->pid);
 
@@ -992,7 +992,7 @@ wayland_tbm_server_client_queue_set_dequeue_cb(struct wayland_tbm_client_queue *
        WL_TBM_RETURN_VAL_IF_FAIL(cqueue->wl_tbm_queue != NULL, 0);
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("    pid:%d\n", cqueue->pid);
+       WL_TBM_TRACE("    pid:%d", cqueue->pid);
 #endif
        cqueue->dequeue_cb = dequeue_cb;
        cqueue->dequeue_cb_data = user_data;
@@ -1035,7 +1035,7 @@ wayland_tbm_server_client_queue_export_buffer2(
        if (!_wayland_tbm_server_export_surface(cqueue->wl_tbm,
                                                tbm_buffer->wl_buffer,
                                                surface)) {
-               WL_TBM_S_LOG("Failed to send the surface to the wl_tbm_queue\n");
+               WL_TBM_S_LOG("Failed to send the surface to the wl_tbm_queue");
                wl_resource_destroy(tbm_buffer->wl_buffer);
                tbm_surface_internal_unref(surface);
                return NULL;
@@ -1083,7 +1083,7 @@ wayland_tbm_server_client_queue_export_buffer(
        if (!_wayland_tbm_server_export_surface(cqueue->wl_tbm,
                                                tbm_buffer->wl_buffer,
                                                surface)) {
-               WL_TBM_S_LOG("Failed to send the surface to the wl_tbm_queue\n");
+               WL_TBM_S_LOG("Failed to send the surface to the wl_tbm_queue");
                wl_resource_destroy(tbm_buffer->wl_buffer);
                tbm_surface_internal_unref(surface);
                return NULL;
@@ -1105,7 +1105,7 @@ wayland_tbm_server_client_queue_flush(struct wayland_tbm_client_queue *cqueue)
        WL_TBM_RETURN_IF_FAIL(cqueue->wl_tbm_queue != NULL);
 
 #ifdef DEBUG_TRACE
-       WL_TBM_TRACE("    pid:%d\n", cqueue->pid);
+       WL_TBM_TRACE("    pid:%d", cqueue->pid);
 #endif
        WL_TBM_LOG("send flush queue pid:%d", cqueue->pid);
 
index c5054c0..ed18238 100644 (file)
@@ -270,7 +270,7 @@ _wayland_tbm_check_dlog_enable(void)
        env = getenv("WL_TBM_DLOG");
        if (env) {
                bDlog = atoi(env);
-               WL_TBM_LOG("WL_TBM_DLOG=%s\n", env);
+               WL_TBM_LOG("WL_TBM_DLOG=%s", env);
        } else {
                bDlog = 1;
        }