Update Input event thread. and reduce the logs.
authorSung-jae Park <nicesj.park@samsung.com>
Wed, 26 Jun 2013 23:54:28 +0000 (08:54 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Wed, 26 Jun 2013 23:54:28 +0000 (08:54 +0900)
Change-Id: I8d45f484fb581b8f0dbea555b86deec02a056dd0

17 files changed:
packaging/data-provider-master.spec
src/buffer_handler.c
src/client_life.c
src/conf.c
src/event.c
src/fault_manager.c
src/fb.c
src/group.c
src/instance.c
src/io.c
src/package.c
src/parser.c
src/script_handler.c
src/server.c
src/service_common.c
src/util.c
src/xmonitor.c

index db1b9c8..ccd46f7 100644 (file)
@@ -1,6 +1,6 @@
 Name: data-provider-master
 Summary: Master service provider for liveboxes.
-Version: 0.24.12
+Version: 0.24.13
 Release: 1
 Group: HomeTF/Livebox
 License: Flora License
index 79e5c20..e3d431d 100644 (file)
@@ -161,7 +161,6 @@ HAPI struct buffer_info *buffer_handler_create(struct inst_info *inst, enum buff
        info->inst = inst;
        info->buffer = NULL;
 
-       DbgPrint("%dx%d size buffer is created\n", w, h);
        return info;
 }
 
@@ -192,8 +191,6 @@ static inline struct buffer *create_pixmap(struct buffer_info *info)
        buffer->refcnt = 1;
        buffer->state = CREATED;
 
-       DbgPrint("Canvas %dx%d - %d is created\n", info->w, info->h, info->pixel_size);
-
        gem->attachments[0] = DRI2BufferFrontLeft;
        gem->count = 1;
        gem->w = info->w; /*!< This can be changed by DRI2GetBuffers */
@@ -251,12 +248,11 @@ static inline int create_gem(struct buffer *buffer)
                        return LB_STATUS_ERROR_MEMORY;
                }
 
-               DbgPrint("DRI2(gem) is not supported - Fallback to the S/W Backend\n");
+               ErrPrint("DRI2(gem) is not supported - Fallback to the S/W Backend\n");
                return LB_STATUS_SUCCESS;
        }
 
        DRI2CreateDrawable(disp, gem->pixmap);
-       DbgPrint("DRI2CreateDrawable is done\n");
 
        gem->dri2_buffer = DRI2GetBuffers(disp, gem->pixmap,
                                        &gem->w, &gem->h, gem->attachments, gem->count, &gem->buf_count);
@@ -265,11 +261,6 @@ static inline int create_gem(struct buffer *buffer)
                DRI2DestroyDrawable(disp, gem->pixmap);
                return LB_STATUS_ERROR_FAULT;
        }
-       DbgPrint("dri2_buffer: %p, name: %p, %dx%d\n",
-                               gem->dri2_buffer, gem->dri2_buffer->name, gem->w, gem->h);
-       DbgPrint("dri2_buffer->pitch : %d, buf_count: %d\n",
-                               gem->dri2_buffer->pitch, gem->buf_count);
-
        /*!
         * \How can I destroy this?
         */
@@ -282,15 +273,14 @@ static inline int create_gem(struct buffer *buffer)
 
        if (gem->dri2_buffer->pitch != gem->w * gem->depth) {
                gem->compensate_data = calloc(1, gem->w * gem->h * gem->depth);
-               if (!gem->compensate_data) {
+               if (!gem->compensate_data)
                        ErrPrint("Failed to allocate heap\n");
-               } else {
-                       DbgPrint("Allocate compensate buffer %p(%dx%d %d)\n",
-                                                               gem->compensate_data,
-                                                               gem->w, gem->h, gem->depth);
-               }
        }
 
+       DbgPrint("dri2_buffer: %p, name: %p, %dx%d, pitch: %d, buf_count: %d, depth: %d, compensate: %p\n",
+                               gem->dri2_buffer, gem->dri2_buffer->name, gem->w, gem->h,
+                               gem->dri2_buffer->pitch, gem->buf_count, gem->depth, gem->compensate_data);
+
        return LB_STATUS_SUCCESS;
 }
 
@@ -303,10 +293,10 @@ static inline void *acquire_gem(struct buffer *buffer)
 
        gem = (struct gem_data *)buffer->data;
        if (s_info.fd < 0) {
-               DbgPrint("GEM is not supported - Use the fake gem buffer\n");
+               ErrPrint("GEM is not supported - Use the fake gem buffer\n");
        } else {
                if (!gem->pixmap_bo) {
-                       DbgPrint("GEM is not created\n");
+                       ErrPrint("GEM is not created\n");
                        return NULL;
                }
 
@@ -339,7 +329,7 @@ static inline void release_gem(struct buffer *buffer)
 
        gem = (struct gem_data *)buffer->data;
        if (s_info.fd >= 0 && !gem->pixmap_bo) {
-               DbgPrint("GEM is not created\n");
+               ErrPrint("GEM is not created\n");
                return;
        }
 
@@ -385,7 +375,7 @@ static inline void release_gem(struct buffer *buffer)
                        gem->data = NULL;
                }
        } else if (gem->refcnt < 0) {
-               DbgPrint("Invalid refcnt: %d (reset)\n", gem->refcnt);
+               ErrPrint("Invalid refcnt: %d (reset)\n", gem->refcnt);
                gem->refcnt = 0;
        }
 }
@@ -403,7 +393,7 @@ static inline int destroy_pixmap(struct buffer *buffer)
                if (!disp)
                        return LB_STATUS_ERROR_IO;
 
-               DbgPrint("Free pixmap 0x%X\n", gem->pixmap);
+               DbgPrint("pixmap 0x%X\n", gem->pixmap);
                XFreePixmap(disp, gem->pixmap);
        }
 
@@ -438,7 +428,6 @@ static inline int destroy_gem(struct buffer *buffer)
                        tbm_bo_unref(gem->pixmap_bo);
                        gem->pixmap_bo = NULL;
 
-                       DbgPrint("DRI2DestroyDrawable\n");
                        DRI2DestroyDrawable(ecore_x_display_get(), gem->pixmap);
                }
        } else if (gem->data) {
@@ -606,7 +595,7 @@ HAPI int buffer_handler_load(struct buffer_info *info)
        int ret;
 
        if (!info) {
-               DbgPrint("buffer handler is nil\n");
+               ErrPrint("buffer handler is nil\n");
                return LB_STATUS_ERROR_INVALID;
        }
 
@@ -738,7 +727,7 @@ HAPI int buffer_handler_unload(struct buffer_info *info)
        int ret;
 
        if (!info) {
-               DbgPrint("buffer handler is NIL\n");
+               ErrPrint("buffer handler is NIL\n");
                return LB_STATUS_ERROR_INVALID;
        }
 
@@ -814,10 +803,13 @@ HAPI void *buffer_handler_fb(struct buffer_info *info)
                int ret;
 
                /*!
+                * \note
+                * For getting the buffer address of gem.
                 */
                canvas = buffer_handler_pixmap_acquire_buffer(info);
                ret = buffer_handler_pixmap_release_buffer(canvas);
-               DbgPrint("Canvas %p(%d) (released but still in use)\n", canvas, ret);
+               if (ret < 0)
+                       ErrPrint("Failed to release buffer: %d\n", ret);
                return canvas;
        }
 
@@ -909,7 +901,7 @@ HAPI void *buffer_handler_pixmap_ref(struct buffer_info *info)
 
                buffer = create_pixmap(info);
                if (!buffer) {
-                       DbgPrint("Failed to create a pixmap\n");
+                       ErrPrint("Failed to create a pixmap\n");
                        return NULL;
                }
 
@@ -1264,19 +1256,19 @@ HAPI int buffer_handler_init(void)
        drm_magic_t magic;
 
        if (!DRI2QueryExtension(ecore_x_display_get(), &s_info.evt_base, &s_info.err_base)) {
-               DbgPrint("DRI2 is not supported\n");
+               ErrPrint("DRI2 is not supported\n");
                return LB_STATUS_SUCCESS;
        }
 
        if (!DRI2QueryVersion(ecore_x_display_get(), &dri2Major, &dri2Minor)) {
-               DbgPrint("DRI2 is not supported\n");
+               ErrPrint("DRI2 is not supported\n");
                s_info.evt_base = 0;
                s_info.err_base = 0;
                return LB_STATUS_SUCCESS;
        }
 
        if (!DRI2Connect(ecore_x_display_get(), DefaultRootWindow(ecore_x_display_get()), &driverName, &deviceName)) {
-               DbgPrint("DRI2 is not supported\n");
+               ErrPrint("DRI2 is not supported\n");
                s_info.evt_base = 0;
                s_info.err_base = 0;
                return LB_STATUS_SUCCESS;
@@ -1295,7 +1287,7 @@ HAPI int buffer_handler_init(void)
        DbgFree(deviceName);
        DbgFree(driverName);
        if (s_info.fd < 0) {
-               DbgPrint("Failed to open a drm device: (%s)\n", strerror(errno));
+               ErrPrint("Failed to open a drm device: (%s)\n", strerror(errno));
                s_info.evt_base = 0;
                s_info.err_base = 0;
                return LB_STATUS_SUCCESS;
@@ -1304,7 +1296,7 @@ HAPI int buffer_handler_init(void)
        drmGetMagic(s_info.fd, &magic);
        DbgPrint("DRM Magic: 0x%X\n", magic);
        if (!DRI2Authenticate(ecore_x_display_get(), DefaultRootWindow(ecore_x_display_get()), (unsigned int)magic)) {
-               DbgPrint("Failed to do authenticate for DRI2\n");
+               ErrPrint("Failed to do authenticate for DRI2\n");
                if (close(s_info.fd) < 0)
                        ErrPrint("close: %s\n", strerror(errno));
                s_info.fd = -1;
@@ -1315,7 +1307,7 @@ HAPI int buffer_handler_init(void)
 
        s_info.slp_bufmgr = tbm_bufmgr_init(s_info.fd);
        if (!s_info.slp_bufmgr) {
-               DbgPrint("Failed to init bufmgr\n");
+               ErrPrint("Failed to init bufmgr\n");
                if (close(s_info.fd) < 0)
                        ErrPrint("close: %s\n", strerror(errno));
                s_info.fd = -1;
index dd0e49c..64c9920 100644 (file)
@@ -170,8 +170,6 @@ static inline void destroy_client_data(struct client_node *client)
        struct data_item *data;
        struct subscribe_item *item;
 
-       DbgPrint("Client %p is destroyed\n", client);
-
        invoke_global_destroyed_cb(client);
        client_rpc_fini(client); /*!< Finalize the RPC after invoke destroy callbacks */
 
index 1c05206..31c33a0 100644 (file)
@@ -100,13 +100,11 @@ static void conf_update_size(void)
 static void use_xmonitor(char *buffer)
 {
        g_conf.use_xmonitor = !strcasecmp(buffer, "true");
-       DbgPrint("Use xmonitor: %d\n", g_conf.use_xmonitor);
 }
 
 static void use_sw_backend_handler(char *buffer)
 {
        g_conf.use_sw_backend = !strcasecmp(buffer, "true");
-       DbgPrint("SW Backend: %d\n", g_conf.use_sw_backend);
 }
 
 static void provider_method_handler(char *buffer)
@@ -114,41 +112,33 @@ static void provider_method_handler(char *buffer)
        g_conf.provider_method = strdup(buffer);
        if (!g_conf.provider_method)
                ErrPrint("Heap: %s\n", strerror(errno));
-
-       DbgPrint("Method: %s\n", g_conf.provider_method);
 }
 
 static void debug_mode_handler(char *buffer)
 {
        g_conf.debug_mode = !strcasecmp(buffer, "true");
-       DbgPrint("Debug mode: %d\n", g_conf.debug_mode);
 }
 
 static void overwrite_content_handler(char *buffer)
 {
        g_conf.overwrite_content = !strcasecmp(buffer, "true");
-       DbgPrint("Overwrite Content: %d\n", g_conf.overwrite_content);
 }
 
 static void com_core_thread_handler(char *buffer)
 {
        g_conf.com_core_thread = !strcasecmp(buffer, "true");
-       DbgPrint("Com core thread: %d\n", g_conf.com_core_thread);
 }
 
 static void base_width_handler(char *buffer)
 {
        if (sscanf(buffer, "%d", &g_conf.base_width) != 1)
                ErrPrint("Failed to parse the base_width\n");
-
-       DbgPrint("Base width: %d\n", g_conf.base_width);
 }
 
 static void base_height_handler(char *buffer)
 {
        if (sscanf(buffer, "%d", &g_conf.base_height) != 1)
                ErrPrint("Failed to parse the base_height\n");
-       DbgPrint("Base height: %d\n", g_conf.base_height);
 }
 
 static void minimum_period_handler(char *buffer)
@@ -163,7 +153,6 @@ static void script_handler(char *buffer)
        g_conf.default_conf.script = strdup(buffer);
        if (!g_conf.default_conf.script)
                ErrPrint("Heap: %s\n", strerror(errno));
-       DbgPrint("Default script: %s\n", g_conf.default_conf.script);
 }
 
 static void default_abi_handler(char *buffer)
@@ -171,7 +160,6 @@ static void default_abi_handler(char *buffer)
        g_conf.default_conf.abi = strdup(buffer);
        if (!g_conf.default_conf.abi)
                ErrPrint("Heap: %s\n", strerror(errno));
-       DbgPrint("Default ABI: %s\n", g_conf.default_conf.abi);
 }
 
 static void default_group_handler(char *buffer)
@@ -179,7 +167,6 @@ static void default_group_handler(char *buffer)
        g_conf.default_conf.pd_group = strdup(buffer);
        if (!g_conf.default_conf.pd_group)
                ErrPrint("Heap: %s\n", strerror(errno));
-       DbgPrint("Default PD Group: %s\n", g_conf.default_conf.pd_group);
 }
 
 static void default_period_handler(char *buffer)
@@ -201,7 +188,6 @@ static void default_content_handler(char *buffer)
        g_conf.default_content = strdup(buffer);
        if (!g_conf.default_content)
                ErrPrint("Heap: %s\n", strerror(errno));
-       DbgPrint("Default content: %s\n", g_conf.default_content);
 }
 
 static void default_title_handler(char *buffer)
@@ -209,14 +195,12 @@ static void default_title_handler(char *buffer)
        g_conf.default_title = strdup(buffer);
        if (!g_conf.default_title)
                ErrPrint("Heap: %s\n", strerror(errno));
-       DbgPrint("Default title: %s\n", g_conf.default_title);
 }
 
 static void minimum_space_handler(char *buffer)
 {
        if (sscanf(buffer, "%lu", &g_conf.minimum_space) != 1)
                ErrPrint("Failed to parse the minimum_space\n");
-       DbgPrint("Minimum space: %lu\n", g_conf.minimum_space);
 }
 
 static void replace_tag_handler(char *buffer)
@@ -224,7 +208,6 @@ static void replace_tag_handler(char *buffer)
        g_conf.replace_tag = strdup(buffer);
        if (!g_conf.replace_tag)
                ErrPrint("Heap: %s\n", strerror(errno));
-       DbgPrint("Replace Tag: %s\n", g_conf.replace_tag);
 }
 
 static void slave_ttl_handler(char *buffer)
@@ -245,21 +228,18 @@ static void max_log_line_handler(char *buffer)
 {
        if (sscanf(buffer, "%d", &g_conf.max_log_line) != 1)
                ErrPrint("Failed to parse the max_log_line\n");
-       DbgPrint("Max log line: %d\n", g_conf.max_log_line);
 }
 
 static void max_log_file_handler(char *buffer)
 {
        if (sscanf(buffer, "%d", &g_conf.max_log_file) != 1)
                ErrPrint("Failed to parse the max_log_file\n");
-       DbgPrint("Max log file: %d\n", g_conf.max_log_file);
 }
 
 static void sqlite_flush_max_handler(char *buffer)
 {
        if (sscanf(buffer, "%lu", &g_conf.sqlite_flush_max) != 1)
                ErrPrint("Failed to parse the sqlite_flush_max\n");
-       DbgPrint("Flush size: %lu\n", g_conf.sqlite_flush_max);
 }
 
 static void db_path_handler(char *buffer)
@@ -267,7 +247,6 @@ static void db_path_handler(char *buffer)
        g_conf.path.db = strdup(buffer);
        if (!g_conf.path.db)
                ErrPrint("Heap: %s\n", strerror(errno));
-       DbgPrint("DB Path: %s\n", g_conf.path.db);
 }
 
 static void reader_path_handler(char *buffer)
@@ -275,7 +254,6 @@ static void reader_path_handler(char *buffer)
        g_conf.path.reader = strdup(buffer);
        if (!g_conf.path.reader)
                ErrPrint("Heap: %s\n", strerror(errno));
-       DbgPrint("Reader Path: %s\n", g_conf.path.reader);
 }
 
 static void always_path_handler(char *buffer)
@@ -283,7 +261,6 @@ static void always_path_handler(char *buffer)
        g_conf.path.always = strdup(buffer);
        if (!g_conf.path.always)
                ErrPrint("Heap: %s\n", strerror(errno));
-       DbgPrint("Always Path: %s\n", g_conf.path.always);
 }
 
 static void log_path_handler(char *buffer)
@@ -291,7 +268,6 @@ static void log_path_handler(char *buffer)
        g_conf.path.slave_log = strdup(buffer);
        if (!g_conf.path.slave_log)
                ErrPrint("Heap: %s\n", strerror(errno));
-       DbgPrint("LOG Path: %s\n", g_conf.path.slave_log);
 }
 
 static void script_port_path_handler(char *buffer)
@@ -299,7 +275,6 @@ static void script_port_path_handler(char *buffer)
        g_conf.path.script_port = strdup(buffer);
        if (!g_conf.path.script_port)
                ErrPrint("Heap: %s\n", strerror(errno));
-       DbgPrint("Script Port PATH: %s\n", g_conf.path.script_port);
 }
 
 static void share_path_handler(char *buffer)
@@ -307,7 +282,6 @@ static void share_path_handler(char *buffer)
        g_conf.path.image = strdup(buffer);
        if (!g_conf.path.image)
                ErrPrint("Heap: %s\n", strerror(errno));
-       DbgPrint("Shared folder: %s\n", g_conf.path.image);
 }
 
 static void input_path_handler(char *buffer)
@@ -315,7 +289,6 @@ static void input_path_handler(char *buffer)
        g_conf.path.input = strdup(buffer);
        if (!g_conf.path.input)
                ErrPrint("Heap: %s\n", strerror(errno));
-       DbgPrint("Input device: %s\n", g_conf.path.input);
 }
 
 static void ping_time_handler(char *buffer)
@@ -329,7 +302,6 @@ static void slave_max_loader(char *buffer)
 {
        if (sscanf(buffer, "%d", &g_conf.slave_max_load) != 1)
                ErrPrint("Failed to parse the slave_max_load\n");
-       DbgPrint("Max load: %d\n", g_conf.slave_max_load);
 }
 
 static void pd_request_timeout_handler(char *buffer)
@@ -638,7 +610,6 @@ HAPI int conf_loader(void)
 
                                if (token_idx >= 0 && token_handler[token_idx].handler) {
                                        buffer[buffer_idx] = '\0';
-                                       DbgPrint("BUFFER: [%s]\n", buffer);
                                        token_handler[token_idx].handler(buffer);
                                }
 
index 39ff21d..d6dd920 100644 (file)
@@ -48,7 +48,6 @@ static struct info {
        int evt_pipe[PIPE_MAX];
        int tcb_pipe[PIPE_MAX];
        Ecore_Fd_Handler *event_handler;
-       Ecore_Fd_Handler *tcb_handler;
 
        int (*event_cb)(enum event_state state, struct event_data *event, void *data);
        void *cbdata;
@@ -203,14 +202,17 @@ static void *event_thread_main(void *data)
        char *ptr = (char *)&input_event;
        int offset = 0;
        int readsize = 0;
-       char event_ch = EVENT_CH;
+       int fd;
 
        DbgPrint("Initiated\n");
 
        while (1) {
                FD_ZERO(&set);
                FD_SET(s_info.handle, &set);
-               ret = select(s_info.handle + 1, &set, NULL, NULL, NULL);
+               FD_SET(s_info.tcb_pipe[PIPE_READ], &set);
+
+               fd = s_info.handle > s_info.tcb_pipe[PIPE_READ] ? s_info.handle : s_info.tcb_pipe[PIPE_READ];
+               ret = select(fd + 1, &set, NULL, NULL, NULL);
                if (ret < 0) {
                        ret = -errno;
                        if (errno == EINTR) {
@@ -225,105 +227,36 @@ static void *event_thread_main(void *data)
                        break;
                }
 
-               if (!FD_ISSET(s_info.handle, &set)) {
-                       ErrPrint("Unexpected handle is toggled\n");
-                       ret = LB_STATUS_ERROR_INVALID;
-                       break;
-               }
-
-               readsize = read(s_info.handle, ptr + offset, sizeof(input_event) - offset);
-               if (readsize < 0) {
-                       ErrPrint("Unable to read device: %s / fd: %d / offset: %d / size: %d - %d\n", strerror(errno), s_info.handle, offset, sizeof(input_event), readsize);
-                       ret = LB_STATUS_ERROR_FAULT;
-                       break;
-               }
-
-               offset += readsize;
-               if (offset == sizeof(input_event)) {
-                       offset = 0;
-                       if (processing_input_event(&input_event) < 0) {
+               if (FD_ISSET(s_info.handle, &set)) {
+                       readsize = read(s_info.handle, ptr + offset, sizeof(input_event) - offset);
+                       if (readsize < 0) {
+                               ErrPrint("Unable to read device: %s / fd: %d / offset: %d / size: %d - %d\n", strerror(errno), s_info.handle, offset, sizeof(input_event), readsize);
                                ret = LB_STATUS_ERROR_FAULT;
                                break;
                        }
-               }
-       }
 
-       if (write(s_info.tcb_pipe[PIPE_WRITE], &event_ch, sizeof(event_ch)) != sizeof(event_ch))
-               ErrPrint("Unable to write PIPE: %s\n", strerror(errno));
-
-       return (void *)ret;
-}
-
-static inline int reclaim_tcb_resources(void)
-{
-       int status;
-       struct event_data *event;
-       void *ret;
-
-       if (close(s_info.handle) < 0)
-               ErrPrint("Unable to release the fd: %s\n", strerror(errno));
-
-       s_info.handle = -1;
-       DbgPrint("Event handler deactivated\n");
-
-       status = pthread_join(s_info.tid, &ret);
-       if (status != 0)
-               ErrPrint("Failed to join a thread: %s\n", strerror(errno));
-       else
-               DbgPrint("Thread returns: %d\n", (int)ret);
-
-       ecore_main_fd_handler_del(s_info.event_handler);
-       s_info.event_handler = NULL;
-
-       ecore_main_fd_handler_del(s_info.tcb_handler);
-       s_info.tcb_handler = NULL;
-
-       CLOSE_PIPE(s_info.tcb_pipe);
-       CLOSE_PIPE(s_info.evt_pipe);
-
-       EINA_LIST_FREE(s_info.event_list, event) {
-               if (s_info.event_cb) {
-                       if (s_info.event_state == EVENT_STATE_DEACTIVATE) {
-                               s_info.event_state = EVENT_STATE_ACTIVATE;
-                       } else if (s_info.event_state == EVENT_STATE_ACTIVATE) {
-                               s_info.event_state = EVENT_STATE_ACTIVATED;
+                       offset += readsize;
+                       if (offset == sizeof(input_event)) {
+                               offset = 0;
+                               if (processing_input_event(&input_event) < 0) {
+                                       ret = LB_STATUS_ERROR_FAULT;
+                                       break;
+                               }
                        }
-                       s_info.event_cb(s_info.event_state, event, s_info.cbdata);
                }
-               free(event);
-       }
-
-       if (s_info.event_state != EVENT_STATE_DEACTIVATE) {
-               s_info.event_state = EVENT_STATE_DEACTIVATE;
 
-               if (s_info.event_cb)
-                       s_info.event_cb(s_info.event_state, &s_info.event_data, s_info.cbdata);
-       }
+               if (FD_ISSET(s_info.tcb_pipe[PIPE_READ], &set)) {
+                       char event_ch;
 
-       s_info.event_data.x = -1;
-       s_info.event_data.y = -1;
-       return LB_STATUS_SUCCESS;
-}
+                       if (read(s_info.tcb_pipe[PIPE_READ], &event_ch, sizeof(event_ch)) != sizeof(event_ch))
+                               ErrPrint("Unable to read TCB_PIPE: %s\n", strerror(errno));
 
-static Eina_Bool event_deactivate_cb(void *data, Ecore_Fd_Handler *handler)
-{
-       int fd;
-       char event_ch;
-
-       fd = ecore_main_fd_handler_fd_get(handler);
-       if (fd < 0) {
-               ErrPrint("Invalid fd\n");
-               return ECORE_CALLBACK_CANCEL;
-       }
-
-       if (read(fd, &event_ch, sizeof(event_ch)) != sizeof(event_ch)) {
-               ErrPrint("Unable to read event ch: %s\n", strerror(errno));
-               return ECORE_CALLBACK_CANCEL;
+                       ret = LB_STATUS_ERROR_CANCEL;
+                       break;
+               }
        }
 
-       DbgPrint("Deactivated event received: %c\n", event_ch);
-       reclaim_tcb_resources();
-       return ECORE_CALLBACK_CANCEL;
+       return (void *)ret;
 }
 
 static Eina_Bool event_read_cb(void *data, Ecore_Fd_Handler *handler)
@@ -424,29 +357,12 @@ HAPI int event_activate(int x, int y, int (*event_cb)(enum event_state state, st
                return LB_STATUS_ERROR_FAULT;
        }
 
-       s_info.tcb_handler = ecore_main_fd_handler_add(s_info.tcb_pipe[PIPE_READ], ECORE_FD_READ, event_deactivate_cb, NULL, NULL, NULL);
-       if (!s_info.event_handler) {
-               ecore_main_fd_handler_del(s_info.event_handler);
-               s_info.event_handler = NULL;
-
-               if (close(s_info.handle) < 0)
-                       ErrPrint("Failed to close handle: %s\n", strerror(errno));
-               s_info.handle = -1;
-
-               CLOSE_PIPE(s_info.tcb_pipe);
-               CLOSE_PIPE(s_info.evt_pipe);
-               return LB_STATUS_ERROR_FAULT;
-       }
-
        status = pthread_create(&s_info.tid, NULL, event_thread_main, NULL);
        if (status != 0) {
                ErrPrint("Failed to initiate the thread: %s\n", strerror(status));
                ecore_main_fd_handler_del(s_info.event_handler);
                s_info.event_handler = NULL;
 
-               ecore_main_fd_handler_del(s_info.tcb_handler);
-               s_info.tcb_handler = NULL;
-
                if (close(s_info.handle) < 0)
                        ErrPrint("close: %s\n", strerror(errno));
                s_info.handle = -1;
@@ -467,12 +383,59 @@ HAPI int event_activate(int x, int y, int (*event_cb)(enum event_state state, st
 
 HAPI int event_deactivate(void)
 {
+       int status;
+       struct event_data *event;
+       void *ret;
+       char event_ch = EVENT_CH;
+
        if (s_info.handle < 0) {
                ErrPrint("Event handler is not actiavated\n");
                return LB_STATUS_SUCCESS;
        }
 
-       return reclaim_tcb_resources();
+       if (write(s_info.tcb_pipe[PIPE_WRITE], &event_ch, sizeof(event_ch)) != sizeof(event_ch))
+               ErrPrint("Unable to write tcb_pipe: %s\n", strerror(errno));
+
+       status = pthread_join(s_info.tid, &ret);
+       if (status != 0)
+               ErrPrint("Failed to join a thread: %s\n", strerror(errno));
+       else
+               DbgPrint("Thread returns: %d\n", (int)ret);
+
+       ecore_main_fd_handler_del(s_info.event_handler);
+       s_info.event_handler = NULL;
+
+       if (close(s_info.handle) < 0)
+               ErrPrint("Unable to release the fd: %s\n", strerror(errno));
+
+       s_info.handle = -1;
+       DbgPrint("Event handler deactivated\n");
+
+       CLOSE_PIPE(s_info.tcb_pipe);
+       CLOSE_PIPE(s_info.evt_pipe);
+
+       EINA_LIST_FREE(s_info.event_list, event) {
+               if (s_info.event_cb) {
+                       if (s_info.event_state == EVENT_STATE_DEACTIVATE) {
+                               s_info.event_state = EVENT_STATE_ACTIVATE;
+                       } else if (s_info.event_state == EVENT_STATE_ACTIVATE) {
+                               s_info.event_state = EVENT_STATE_ACTIVATED;
+                       }
+                       s_info.event_cb(s_info.event_state, event, s_info.cbdata);
+               }
+               free(event);
+       }
+
+       if (s_info.event_state != EVENT_STATE_DEACTIVATE) {
+               s_info.event_state = EVENT_STATE_DEACTIVATE;
+
+               if (s_info.event_cb)
+                       s_info.event_cb(s_info.event_state, &s_info.event_data, s_info.cbdata);
+       }
+
+       s_info.event_data.x = -1;
+       s_info.event_data.y = -1;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int event_is_activated(void)
index 7e44685..7546f95 100644 (file)
@@ -122,7 +122,6 @@ HAPI void fault_unicast_info(struct client_node *client, const char *pkgname, co
                return;
 
        client_rpc_async_request(client, packet);
-       DbgPrint("Fault package: %s\n", pkgname);
 }
 
 HAPI void fault_broadcast_info(const char *pkgname, const char *filename, const char *func)
@@ -136,7 +135,6 @@ HAPI void fault_broadcast_info(const char *pkgname, const char *filename, const
        }
 
        client_broadcast(NULL, packet);
-       DbgPrint("Fault package: %s\n", pkgname);
 }
 
 static inline void dump_fault_info(const char *name, pid_t pid, const char *pkgname, const char *filename, const char *funcname)
index e3f4f0d..1056dc5 100644 (file)
--- a/src/fb.c
+++ b/src/fb.c
@@ -51,8 +51,6 @@ static void *alloc_fb(void *data, int size)
 {
        struct fb_info *info = data;
 
-       DbgPrint("FB size: %d\n", size);
-
        if (buffer_handler_load(info->buffer) < 0) {
                ErrPrint("Failed to load buffer handler\n");
                return NULL;
@@ -149,7 +147,6 @@ HAPI int fb_create_buffer(struct fb_info *info)
        Evas *e;
 
        buffer_handler_get_size(info->buffer, &ow, &oh);
-       DbgPrint("Buffer handler size: %dx%d\n", ow, oh);
        if (ow == 0 && oh == 0) {
                DbgPrint("ZERO Size FB accessed\n");
                return LB_STATUS_SUCCESS;
index 61c9833..02851b7 100644 (file)
@@ -205,7 +205,6 @@ HAPI struct cluster *group_create_cluster(const char *name)
 
        cluster->category_list = NULL;
 
-       DbgPrint("Cluster %s is created\n", cluster->name);
        s_info.cluster_list = eina_list_append(s_info.cluster_list, cluster);
        return cluster;
 }
@@ -243,7 +242,6 @@ HAPI struct category *group_create_category(struct cluster *cluster, const char
        category->cluster = cluster;
        category->info_list = NULL;
 
-       DbgPrint("Category %s is created\n", category->name);
        cluster->category_list = eina_list_append(cluster->category_list, category);
        return category;
 }
@@ -258,7 +256,6 @@ static inline void destroy_cluster(struct cluster *cluster)
                group_destroy_category(category);
        }
 
-       DbgPrint("Destroy cluster: %s\n", cluster->name);
        DbgFree(cluster->name);
        DbgFree(cluster);
 }
@@ -290,7 +287,6 @@ static inline void destroy_category(struct category *category)
                group_destroy_context_info(info);
        }
 
-       DbgPrint("Destroy category: %s\n", category->name);
        DbgFree(category->name);
        DbgFree(category);
 }
@@ -653,7 +649,6 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                                DbgFree(name);
                                                return LB_STATUS_ERROR_FAULT;
                                        }
-                                       DbgPrint("Keep this syntax only for the compatibility\n");
                                } else if (is_open == 2) {
                                        item = group_add_context_item(info, name);
                                        if (!item) {
@@ -748,7 +743,6 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                        return LB_STATUS_ERROR_FAULT;
                                }
 
-                               DbgPrint("Keep this syntax only for the compatibility: %s\n", name);
                                state = CLUSTER;
                                break;
                        case CONTEXT_ITEM:
@@ -770,7 +764,6 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                                return LB_STATUS_ERROR_FAULT;
                                        }
 
-                                       DbgPrint("Keep this syntax only for the compatibility: %s\n", name);
                                        state = CLUSTER;
                                } else if (is_open == 2) {
                                        state = CATEGORY;
index c87685d..bab59ef 100644 (file)
@@ -169,16 +169,13 @@ static inline void timer_thaw(struct inst_info *inst)
        pending = ecore_timer_pending_get(inst->update_timer);
        delay = util_time_delay_for_compensation(period) - pending;
        ecore_timer_delay(inst->update_timer, delay);
-       DbgPrint("Compensated: %lf\n", delay);
 
        if (inst->sleep_at == 0.0f)
                return;
 
        sleep_time = util_timestamp() - inst->sleep_at;
-       if (sleep_time > pending) {
-               DbgPrint("Update time elapsed\n");
+       if (sleep_time > pending)
                (void)update_timer_cb(inst);
-       }
 
        inst->sleep_at = 0.0f;
 }
@@ -206,7 +203,7 @@ static int viewer_deactivated_cb(struct client_node *client, void *data)
 
        DbgPrint("%d is deleted from the list of viewer of %s(%s)\n", client_pid(client), package_name(instance_package(inst)), instance_id(inst));
        if (!eina_list_data_find(inst->client_list, client)) {
-               DbgPrint("Not found\n");
+               ErrPrint("Not found\n");
                return LB_STATUS_ERROR_NOT_EXIST;
        }
 
@@ -313,8 +310,6 @@ static inline void instance_send_resized_event(struct inst_info *inst, int is_pd
        else
                id = "";
 
-       DbgPrint("Size is changed to %dx%d (%s) %s\n", w, h, id, is_pd ? "pd" : "lb");
-
        packet = packet_create_noack("size_changed", "sssiiii", pkgname, inst->id, id, is_pd, w, h, status);
        if (packet)
                CLIENT_SEND_EVENT(inst, packet);
@@ -674,7 +669,6 @@ static Eina_Bool update_timer_cb(void *data)
 {
        struct inst_info *inst = (struct inst_info *)data;
 
-       DbgPrint("Update instance %s (%s) %s/%s\n", package_name(inst->info), inst->id, inst->cluster, inst->category);
        slave_rpc_request_update(package_name(inst->info), inst->id, inst->cluster, inst->category);
        return ECORE_CALLBACK_RENEW;
 }
@@ -709,14 +703,12 @@ static inline int fork_package(struct inst_info *inst, const char *pkgname)
 
        if (package_secured(info)) {
                if (inst->lb.period > 0.0f) {
-                       DbgPrint("Register the update timer for secured livebox [%s]\n", package_name(info));
                        inst->update_timer = util_timer_add(inst->lb.period, update_timer_cb, inst);
                        if (!inst->update_timer)
                                ErrPrint("Failed to add an update timer for instance %s\n", inst->id);
                        else
                                timer_freeze(inst); /* Freeze the update timer as default */
                } else {
-                       DbgPrint("secured livebox [%s] has no period (%lf)\n", package_name(info), inst->lb.period);
                        inst->update_timer = NULL;
                }
        }
@@ -850,7 +842,6 @@ static void deactivate_cb(struct slave_node *slave, const struct packet *packet,
         */
 
        if (!packet) {
-               DbgPrint("Consuming a request of a dead process\n");
                /*!
                 * \note
                 * The instance_reload will care this.
@@ -887,7 +878,6 @@ static void deactivate_cb(struct slave_node *slave, const struct packet *packet,
                 */
                switch (inst->requested_state) {
                case INST_ACTIVATED:
-                       DbgPrint("REQ: ACTIVATED\n");
                        instance_state_reset(inst);
                        instance_reactivate(inst);
                        break;
@@ -896,7 +886,6 @@ static void deactivate_cb(struct slave_node *slave, const struct packet *packet,
                        instance_broadcast_deleted_event(inst);
                        instance_state_reset(inst);
                        instance_destroy(inst);
-                       DbgPrint("== %s\n", package_name(info));
                default:
                        /*!< Unable to reach here */
                        break;
@@ -928,7 +917,6 @@ static void deactivate_cb(struct slave_node *slave, const struct packet *packet,
                 * This is not possible, slave will always return LB_STATUS_ERROR_NOT_EXIST, LB_STATUS_ERROR_INVALID, or 0.
                 * but care this exceptional case.
                 */
-               DbgPrint("[%s] instance destroying ret(%d)\n", package_name(inst->info), ret);
                info = inst->info;
                instance_broadcast_deleted_event(inst);
                instance_state_reset(inst);
@@ -952,7 +940,6 @@ static void reactivate_cb(struct slave_node *slave, const struct packet *packet,
        int is_pinned_up;
 
        if (!packet) {
-               DbgPrint("Consuming a request of a dead process\n");
                /*!
                 * \note
                 * instance_reload function will care this.
@@ -977,8 +964,6 @@ static void reactivate_cb(struct slave_node *slave, const struct packet *packet,
 
                DbgFree(inst->content);
                inst->content = tmp;
-
-               DbgPrint("Update content info %s\n", tmp);
        }
 
        if (strlen(title)) {
@@ -992,8 +977,6 @@ static void reactivate_cb(struct slave_node *slave, const struct packet *packet,
 
                DbgFree(inst->title);
                inst->title = tmp;
-
-               DbgPrint("Update title info %s\n", tmp);
        }
 
        if (inst->state == INST_DESTROYED) {
@@ -1097,7 +1080,6 @@ static void reactivate_cb(struct slave_node *slave, const struct packet *packet,
                break;
        default:
                info = inst->info;
-               DbgPrint("[%s] instance destroying ret(%d)\n", package_name(info), ret);
                instance_broadcast_deleted_event(inst);
                instance_state_reset(inst);
                instance_destroy(inst);
@@ -1121,7 +1103,6 @@ static void activate_cb(struct slave_node *slave, const struct packet *packet, v
        int is_pinned_up;
 
        if (!packet) {
-               DbgPrint("Consuming a request of a dead process\n");
                /*!
                 * \note
                 * instance_reload will care this
@@ -1220,7 +1201,6 @@ static void activate_cb(struct slave_node *slave, const struct packet *packet, v
                }
                break;
        default:
-               DbgPrint("[%s] instance destroying ret(%d)\n", package_name(inst->info), ret);
                instance_unicast_deleted_event(inst, NULL);
                instance_state_reset(inst);
                instance_destroy(inst);
@@ -1417,7 +1397,7 @@ HAPI int instance_reactivate(struct inst_info *inst)
        }
 
        if (package_is_fault(inst->info)) {
-               DbgPrint("Fault package [%s]\n", package_name(inst->info));
+               ErrPrint("Fault package [%s]\n", package_name(inst->info));
                return LB_STATUS_ERROR_FAULT;
        }
 
@@ -1483,7 +1463,7 @@ HAPI int instance_activate(struct inst_info *inst)
        }
 
        if (package_is_fault(inst->info)) {
-               DbgPrint("Fault package [%s]\n", package_name(inst->info));
+               ErrPrint("Fault package [%s]\n", package_name(inst->info));
                return LB_STATUS_ERROR_FAULT;
        }
 
@@ -1752,18 +1732,16 @@ HAPI int instance_hold_scroll(struct inst_info *inst, int hold)
 {
        struct packet *packet;
 
-       if (inst->scroll_locked == hold) {
-               DbgPrint("[HOLD] There is changes for hold state: %d\n", hold);
+       DbgPrint("HOLD: (%s) %d\n", inst->id, hold);
+       if (inst->scroll_locked == hold)
                return LB_STATUS_ERROR_ALREADY;
-       }
 
        packet = packet_create_noack("scroll", "ssi", package_name(inst->info), inst->id, hold);
        if (!packet) {
-               ErrPrint("[HOLD] Failed to build a packet\n");
+               ErrPrint("Failed to build a packet\n");
                return LB_STATUS_ERROR_FAULT;
        }
 
-       DbgPrint("[HOLD] (%s) %d\n", inst->id, hold);
        inst->scroll_locked = hold;
        return CLIENT_SEND_EVENT(inst, packet);
 }
@@ -1840,7 +1818,7 @@ HAPI int instance_set_update_mode(struct inst_info *inst, int active_update)
        struct update_mode_cbdata *cbdata;
 
        if (package_is_fault(inst->info)) {
-               DbgPrint("Fault package [%s]\n", package_name(inst->info));
+               ErrPrint("Fault package [%s]\n", package_name(inst->info));
                return LB_STATUS_ERROR_FAULT;
        }
 
@@ -1997,7 +1975,7 @@ HAPI int instance_set_pinup(struct inst_info *inst, int pinup)
        }
 
        if (package_is_fault(inst->info)) {
-               DbgPrint("Fault package [%s]\n", package_name(inst->info));
+               ErrPrint("Fault package [%s]\n", package_name(inst->info));
                return LB_STATUS_ERROR_FAULT;
        }
 
@@ -2030,7 +2008,6 @@ HAPI int instance_freeze_updator(struct inst_info *inst)
        if (!inst->update_timer)
                return LB_STATUS_ERROR_INVALID;
 
-       DbgPrint("Freeze the update timer (%s)\n", inst->id);
        timer_freeze(inst);
        return LB_STATUS_SUCCESS;
 }
@@ -2040,17 +2017,12 @@ HAPI int instance_thaw_updator(struct inst_info *inst)
        if (!inst->update_timer)
                return LB_STATUS_ERROR_INVALID;
 
-       if (client_is_all_paused() || setting_is_lcd_off()) {
-               DbgPrint("Skip thaw (%s)\n", inst->id);
+       if (client_is_all_paused() || setting_is_lcd_off())
                return LB_STATUS_ERROR_INVALID;
-       }
 
-       if (inst->visible == LB_HIDE_WITH_PAUSE) {
-               DbgPrint("Live box is invisible (%s)\n", inst->id);
+       if (inst->visible == LB_HIDE_WITH_PAUSE)
                return LB_STATUS_ERROR_INVALID;
-       }
 
-       DbgPrint("Thaw the update timer (%s)\n", inst->id);
        timer_thaw(inst);
        return LB_STATUS_SUCCESS;
 }
@@ -2062,10 +2034,8 @@ HAPI enum livebox_visible_state instance_visible_state(struct inst_info *inst)
 
 HAPI int instance_set_visible_state(struct inst_info *inst, enum livebox_visible_state state)
 {
-       if (inst->visible == state) {
-               DbgPrint("Visibility has no changed\n");
+       if (inst->visible == state)
                return LB_STATUS_SUCCESS;
-       }
 
        switch (state) {
        case LB_SHOW:
@@ -2197,7 +2167,7 @@ HAPI int instance_resize(struct inst_info *inst, int w, int h)
                return LB_STATUS_ERROR_FAULT;
        }
 
-       DbgPrint("RESIZE: INSTANCE[%s] Request resize[%dx%d] box\n", instance_id(inst), w, h);
+       DbgPrint("RESIZE: [%s] resize[%dx%d]\n", instance_id(inst), w, h);
        ret = slave_rpc_async_request(package_slave(inst->info), package_name(inst->info), packet, resize_cb, cbdata, 0);
        return ret;
 }
@@ -2246,8 +2216,6 @@ static Eina_Bool timer_updator_cb(void *data)
        inst = cbdata->inst;
        DbgFree(cbdata);
 
-       DbgPrint("Update period is changed to %lf from %lf\n", period, inst->lb.period);
-
        inst->lb.period = period;
        if (inst->update_timer) {
                if (inst->lb.period == 0.0f) {
@@ -2285,7 +2253,7 @@ HAPI int instance_set_period(struct inst_info *inst, double period)
        }
 
        if (package_is_fault(inst->info)) {
-               DbgPrint("Fault package [%s]\n", package_name(inst->info));
+               ErrPrint("Fault package [%s]\n", package_name(inst->info));
                return LB_STATUS_ERROR_FAULT;
        }
 
@@ -2338,7 +2306,7 @@ HAPI int instance_clicked(struct inst_info *inst, const char *event, double time
        }
 
        if (package_is_fault(inst->info)) {
-               DbgPrint("Fault package [%s]\n", package_name(inst->info));
+               ErrPrint("Fault package [%s]\n", package_name(inst->info));
                return LB_STATUS_ERROR_FAULT;
        }
 
@@ -2391,7 +2359,7 @@ HAPI int instance_text_signal_emit(struct inst_info *inst, const char *emission,
        }
 
        if (package_is_fault(inst->info)) {
-               DbgPrint("Fault package [%s]\n", package_name(inst->info));
+               ErrPrint("Fault package [%s]\n", package_name(inst->info));
                return LB_STATUS_ERROR_FAULT;
        }
 
@@ -2460,7 +2428,7 @@ HAPI int instance_change_group(struct inst_info *inst, const char *cluster, cons
        }
 
        if (package_is_fault(inst->info)) {
-               DbgPrint("Fault package [%s]\n", package_name(inst->info));
+               ErrPrint("Fault package [%s]\n", package_name(inst->info));
                return LB_STATUS_ERROR_FAULT;
        }
 
@@ -2862,6 +2830,7 @@ HAPI int instance_slave_open_pd(struct inst_info *inst, struct client_node *clie
         */
        (void)slave_freeze_ttl(slave);
 
+       DbgPrint("CREATE_PD\n");
        ret = slave_rpc_request_only(slave, pkgname, packet, 0);
        if (ret < 0) {
                ErrPrint("Unable to send request to slave\n");
@@ -2890,7 +2859,6 @@ HAPI int instance_slave_open_pd(struct inst_info *inst, struct client_node *clie
        }
 
        inst->pd.owner = client;
-       DbgPrint("pd,show event is sent\n");
        return ret;
 }
 
@@ -2982,7 +2950,7 @@ HAPI int instance_client_pd_created(struct inst_info *inst, int status)
 HAPI int instance_client_pd_destroyed(struct inst_info *inst, int status)
 {
        if (!inst->pd.need_to_send_close_event) {
-               DbgPrint("PD is not created\n");
+               ErrPrint("PD is not created\n");
                return LB_STATUS_ERROR_INVALID;
        }
 
index e4ad05c..db03937 100644 (file)
--- a/src/io.c
+++ b/src/io.c
@@ -96,7 +96,6 @@ static inline int load_abi_table(void)
                                        state = ERROR;
                                } else {
                                        group[idx] = '\0';
-                                       DbgPrint("group: %s\n", group);
                                        state = TAG;
                                        idx = 0;
                                        ptr = NULL;
@@ -137,7 +136,6 @@ static inline int load_abi_table(void)
                                tag_id = idx;
                                idx = 0;
                                ptr = NULL;
-                               DbgPrint("tag: %s\n", field[tag_id]);
                        } else if (*ptr == ch) {
                                ptr++;
                        } else {
@@ -163,9 +161,7 @@ static inline int load_abi_table(void)
                                } else if (isspace(ch)) {
                                        int ret;
                                        pkgname[idx] = '\0';
-                                       DbgPrint("value: %s\n", pkgname);
 
-                                       DbgPrint("Add [%s] - [%s]\n", group, pkgname);
                                        ret = abi_add_entry(group, pkgname);
                                        if (ret != 0)
                                                ErrPrint("Failed to add %s for %s\n", pkgname, group);
@@ -196,8 +192,6 @@ static inline int load_abi_table(void)
                        if (idx) {
                                int ret;
                                pkgname[idx] = '\0';
-                               DbgPrint("value: %s\n", pkgname);
-                               DbgPrint("Add [%s] - [%s]\n", group, pkgname);
                                ret = abi_add_entry(group, pkgname);
                                if (ret != 0)
                                        ErrPrint("Failed to add %s for %s\n", pkgname, group);
@@ -315,7 +309,6 @@ static inline int build_provider_info(struct pkg_info *info)
        tmp = (const char *)sqlite3_column_text(stmt, 4);
        if (tmp && strlen(tmp)) {
                package_set_lb_path(info, tmp);
-               DbgPrint("LB Path: %s\n", tmp);
 
                tmp = (const char *)sqlite3_column_text(stmt, 5);
                if (tmp && strlen(tmp))
@@ -326,7 +319,6 @@ static inline int build_provider_info(struct pkg_info *info)
        tmp = (const char *)sqlite3_column_text(stmt, 7);
        if (tmp && strlen(tmp)) {
                package_set_pd_path(info, tmp);
-               DbgPrint("PD Path: %s\n", tmp);
 
                tmp = (const char *)sqlite3_column_text(stmt, 8);
                if (tmp && strlen(tmp))
index 017488e..588a7db 100644 (file)
@@ -223,10 +223,8 @@ static int xmonitor_paused_cb(void *data)
        struct inst_info *inst;
        Eina_List *l;
 
-       if (slave_state(info->slave) != SLAVE_TERMINATED) {
-               DbgPrint("Skip this\n");
+       if (slave_state(info->slave) != SLAVE_TERMINATED)
                return 0;
-       }
 
        EINA_LIST_FOREACH(info->inst_list, l, inst) {
                instance_freeze_updator(inst);
@@ -241,10 +239,8 @@ static int xmonitor_resumed_cb(void *data)
        struct inst_info *inst;
        Eina_List *l;
 
-       if (slave_state(info->slave) != SLAVE_TERMINATED) {
-               DbgPrint("Skip this\n");
+       if (slave_state(info->slave) != SLAVE_TERMINATED)
                return 0;
-       }
 
        EINA_LIST_FOREACH(info->inst_list, l, inst) {
                instance_thaw_updator(inst);
@@ -1057,7 +1053,6 @@ static inline int assign_new_slave(struct pkg_info *info)
                return LB_STATUS_ERROR_INVALID;
        }
 
-       DbgPrint("Slave package: \"%s\" (abi: %s)\n", tmp, info->abi);
        s_pkgname = util_replace_string(tmp, REPLACE_TAG_APPID, info->pkgname);
        if (!s_pkgname) {
                DbgPrint("Failed to get replaced string\n");
@@ -1069,7 +1064,7 @@ static inline int assign_new_slave(struct pkg_info *info)
                }
        }
 
-       DbgPrint("New slave name is %s, it is assigned for livebox %s (using %s)\n", s_name, info->pkgname, s_pkgname);
+       DbgPrint("New slave[%s] is assigned for %s (using %s / abi[%s])\n", s_name, info->pkgname, s_pkgname, info->abi);
        info->slave = slave_create(s_name, info->secured, info->abi, s_pkgname, info->network);
 
        DbgFree(s_name);
@@ -1104,7 +1099,7 @@ HAPI int package_add_instance(struct pkg_info *info, struct inst_info *inst)
                        if (ret < 0)
                                return ret;
                } else {
-                       DbgPrint("Slave %s is assigned for %s\n", slave_name(info->slave), info->pkgname);
+                       DbgPrint("Slave %s is used for %s\n", slave_name(info->slave), info->pkgname);
                }
 
                slave_ref(info->slave);
@@ -1225,7 +1220,7 @@ static int io_uninstall_cb(const char *pkgname, int prime, void *data)
        Eina_List *n;
        struct inst_info *inst;
 
-       DbgPrint("Livebox package %s is uninstalled\n", pkgname);
+       DbgPrint("Package %s is uninstalled\n", pkgname);
        info = package_find(pkgname);
        if (!info) {
                DbgPrint("%s is not yet loaded\n", pkgname);
@@ -1300,7 +1295,6 @@ static int install_cb(const char *pkgname, enum pkgmgr_status status, double val
                return 0;
 
        ret = io_update_livebox_package(pkgname, io_install_cb, NULL);
-       DbgPrint("Processed %d packages\n", ret);
        return 0;
 }
 
@@ -1310,7 +1304,6 @@ static int uninstall_cb(const char *pkgname, enum pkgmgr_status status, double v
 
        if (status == PKGMGR_STATUS_START) {
                ret = io_update_livebox_package(pkgname, io_uninstall_cb, NULL);
-               DbgPrint("Processed %d packages\n", ret);
                if (ret == 0) {
                        /*! for keeping the old style */
                        (void)io_uninstall_cb(pkgname, -1, NULL);
@@ -1340,7 +1333,6 @@ static int update_cb(const char *pkgname, enum pkgmgr_status status, double valu
                return 0;
 
        ret = io_update_livebox_package(pkgname, io_update_cb, NULL);
-       DbgPrint("Processed %d packages\n", ret);
        return 0;
 }
 
index 987772c..babe376 100644 (file)
@@ -177,7 +177,7 @@ HAPI int parser_find(const char *pkgname)
                return LB_STATUS_ERROR_FAULT;
        }
 
-       DbgPrint("Conf file is %s for package %s\n", filename, pkgname);
+       DbgPrint("Conf file %s for package %s\n", filename, pkgname);
 
        EINA_LIST_FOREACH(s_list, l, item) {
                if (!strcmp(item->filename, filename)) {
@@ -671,10 +671,8 @@ HAPI struct parser *parser_load(const char *pkgname)
        linelen = 0;
        do {
                c = getc(fp);
-               if ((c == EOF) && (state == VALUE)) {
-                       DbgPrint("[%s:%d] VALUE state EOF\n", __func__, __LINE__);
+               if ((c == EOF) && (state == VALUE))
                        state = END;
-               }
 
                switch (state) {
                case COMMENT:
index 9811312..40d11c3 100644 (file)
@@ -166,7 +166,7 @@ static void render_pre_cb(void *data, Evas *e, void *event_info)
        struct script_info *info;
 
        if (instance_state(inst) != INST_ACTIVATED) {
-               DbgPrint("Render pre invoked but instance is not activated\n");
+               ErrPrint("Render pre invoked but instance is not activated\n");
                return;
        }
 
@@ -192,7 +192,7 @@ static void render_post_cb(void *data, Evas *e, void *event_info)
        inst = data;
 
        if (instance_state(inst) != INST_ACTIVATED) {
-               DbgPrint("Render post invoked but instance is not activated\n");
+               ErrPrint("Render post invoked but instance is not activated\n");
                return;
        }
 
@@ -350,7 +350,7 @@ HAPI struct script_info *script_handler_create(struct inst_info *inst, const cha
 {
        struct script_info *info;
 
-       DbgPrint("Create script: %s (%s)\n", file, option);
+       DbgPrint("Create script: %s (%s) %dx%d\n", file, option, w, h);
 
        if (!file)
                return NULL;
@@ -378,7 +378,6 @@ HAPI struct script_info *script_handler_create(struct inst_info *inst, const cha
                return NULL;
        }
 
-       DbgPrint("Update info [%dx%d]\n", w, h);
        info->w = w;
        info->h = h;
 
index c7cc98d..5acc524 100644 (file)
@@ -459,8 +459,6 @@ static struct packet *client_text_signal(pid_t pid, int handle, const struct pac
                goto out;
        }
 
-       DbgPrint("pid[%d] pkgname[%s] emission[%s] source[%s]\n", pid, pkgname, emission, source);
-
        /*!
         * \NOTE:
         * Trust the package name which are sent by the client.
@@ -499,40 +497,6 @@ static Eina_Bool lazy_delete_cb(void *data)
        return ECORE_CALLBACK_CANCEL;
 }
 
-/*
-static inline void clear_pd_monitor(struct inst_info *inst)
-{
-       Ecore_Timer *pd_monitor;
-
-       pd_monitor = instance_del_data(inst, "pd,open,monitor");
-       if (pd_monitor) {
-               DbgPrint("Clear pd,open,monitor\n");
-               (void)instance_client_pd_created(inst, LB_STATUS_SUCCESS);
-               ecore_timer_del(pd_monitor);
-               (void)instance_unref(inst);
-               return;
-       }
-
-       pd_monitor = instance_del_data(inst, "pd,close,monitor");
-       if (pd_monitor) {
-               DbgPrint("Clear pd,close,monitor\n");
-               (void)instance_client_pd_destroyed(inst, LB_STATUS_SUCCESS);
-               ecore_timer_del(pd_monitor);
-               (void)instance_unref(inst);
-               return;
-       }
-
-       pd_monitor = instance_del_data(inst, "pd,resize,monitor");
-       if (pd_monitor) {
-               DbgPrint("Clear pd,resize,monitor\n");
-               (void)instance_client_pd_destroyed(inst, LB_STATUS_SUCCESS);
-               ecore_timer_del(pd_monitor);
-               (void)instance_unref(inst);
-               return;
-       }
-}
-*/
-
 static struct packet *client_delete(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, ret */
 {
        struct client_node *client;
@@ -556,8 +520,6 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet *
                goto out;
        }
 
-       DbgPrint("pid[%d] pkgname[%s]\n", pid, pkgname);
-
        /*!
         * \NOTE:
         * Trust the package name which are sent by the client.
@@ -585,7 +547,6 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet *
                                 * So We have to make a delay to send a deleted event.
                                 */
 
-                               DbgPrint("Client has PD\n");
                                item->client = client_ref(client);
                                item->inst = instance_ref(inst);
 
@@ -600,12 +561,10 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet *
                                }
                        }
                } else {
-                       DbgPrint("Client has no permission\n");
+                       ErrPrint("Client has no permission\n");
                        ret = LB_STATUS_ERROR_PERMISSION;
                }
        } else {
-               DbgPrint("Ok. destroy instance\n");
-               //clear_pd_monitor(inst);
                ret = instance_destroy(inst);
        }
 
@@ -2747,8 +2706,6 @@ static struct packet *client_pd_access_hl_next(pid_t pid, int handle, const stru
                        goto out;
                }
 
-               DbgPrint("Buffer type PD\n");
-
                packet_ref((struct packet *)packet);
                ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
        } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -2757,14 +2714,14 @@ static struct packet *client_pd_access_hl_next(pid_t pid, int handle, const stru
 
                script = instance_pd_script(inst);
                if (!script) {
-                       DbgPrint("Script is not created yet\n");
+                       ErrPrint("Script is not created yet\n");
                        ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       DbgPrint("Evas is not exists\n");
+                       ErrPrint("Evas is not exists\n");
                        ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
@@ -2783,12 +2740,11 @@ static struct packet *client_pd_access_hl_next(pid_t pid, int handle, const stru
                                cbdata->status = ret;
 
                                if (!ecore_timer_add(DELAY_TIME, lazy_access_status_cb, cbdata)) {
-                                       DbgPrint("Failed to add timer\n");
+                                       ErrPrint("Failed to add timer\n");
                                        (void)instance_unref(cbdata->inst);
                                        DbgFree(cbdata);
                                        ret = LB_STATUS_ERROR_FAULT;
                                } else {
-                                       DbgPrint("Timer is added\n");
                                        ret = LB_STATUS_SUCCESS;
                                }
                        }
@@ -4581,7 +4537,7 @@ static Eina_Bool lazy_pd_created_cb(void *data)
                if (instance_unref(data)) {
                        int ret;
                        ret = instance_client_pd_created(data, LB_STATUS_SUCCESS);
-                       DbgPrint("Send PD Create event (%d)\n", ret);
+                       DbgPrint("Send PD Create event (%d) to client\n", ret);
                }
        }
 
@@ -4594,7 +4550,7 @@ static Eina_Bool lazy_pd_destroyed_cb(void *data)
                if (instance_unref(data)) {
                        int ret;
                        ret = instance_client_pd_destroyed(data, LB_STATUS_SUCCESS);
-                       DbgPrint("Send PD Destroy event (%d)\n", ret);
+                       DbgPrint("Send PD Destroy event (%d) to client\n", ret);
                }
        }
 
@@ -4693,6 +4649,8 @@ static struct packet *client_create_pd(pid_t pid, int handle, const struct packe
        double x;
        double y;
 
+       DbgPrint("CREATE_PD\n");
+
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
@@ -5503,7 +5461,6 @@ static struct packet *slave_faulted(pid_t pid, int handle, const struct packet *
        } else if (instance_state(inst) == INST_DESTROYED) {
                ErrPrint("Instance(%s) is already destroyed\n", id);
        } else {
-               //clear_pd_monitor(inst);
                ret = instance_destroy(inst);
        }
 
@@ -5935,7 +5892,6 @@ static struct packet *slave_deleted(pid_t pid, int handle, const struct packet *
 
        ret = validate_request(pkgname, id, &inst, NULL);
        if (ret == LB_STATUS_SUCCESS) {
-               //clear_pd_monitor(inst);
                ret = instance_destroyed(inst);
        }
 
@@ -6683,7 +6639,6 @@ static struct packet *liveinfo_pkg_ctrl(pid_t pid, int handle, const struct pack
                if (!inst) {
                        fprintf(fp, "%d\n", ENOENT);
                } else {
-                       //clear_pd_monitor(inst);
                        (void)instance_destroy(inst);
                        fprintf(fp, "%d\n", 0);
                }
index 2b57e56..1895d8c 100644 (file)
@@ -136,7 +136,7 @@ static void *client_packet_pump_main(void *data)
                if (ret < 0) {
                        ret = -errno;
                        if (errno == EINTR) {
-                               DbgPrint("INTERRUPTED\n");
+                               ErrPrint("INTERRUPTED\n");
                                ret = 0;
                                continue;
                        }
index 20bbf42..9b34132 100644 (file)
@@ -373,7 +373,6 @@ HAPI double util_time_delay_for_compensation(double period)
        remain = curtime % _period;
 
        ret = (double)remain / (double)1000000;
-       DbgPrint("curtime: %llu, _period: %llu, remain: %llu, ret: %lf, result: %lf\n", curtime, _period, remain, ret, period - ret);
        return period - ret;
 }
 
index b56966e..e8870df 100644 (file)
@@ -223,10 +223,8 @@ static Eina_Bool client_cb(void *data, int type, void *event)
                return ECORE_CALLBACK_PASS_ON;
 
        if (!strcmp(name, "_X_ILLUME_DEACTIVATE_WINDOW")) {
-               DbgPrint("PAUSE EVENT\n");
                xmonitor_pause(client);
        } else if (!strcmp(name, "_X_ILLUME_ACTIVATE_WINDOW")) {
-               DbgPrint("RESUME EVENT\n");
                xmonitor_resume(client);
        } else {
                /* ignore event */