Sync with the 3.0
authorSung-jae Park <nicesj.park@samsung.com>
Sat, 19 Oct 2013 09:37:19 +0000 (18:37 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Sat, 19 Oct 2013 09:38:08 +0000 (18:38 +0900)
Open DB with READONLY option.

Change-Id: I7081cecc8216dbf6543a0835233b496e06c467c4

CMakeLists.txt
include/debug.h
packaging/data-provider-master.changes [new file with mode: 0644]
packaging/data-provider-master.spec
src/event.c
src/io.c
src/parser.c
src/script_handler.c
src/service_common.c
src/setting.c

index d9e79d4..50bf37e 100644 (file)
@@ -35,8 +35,7 @@ pkg_check_modules(pkg REQUIRED
 )
 
 SET(PACKAGE "${PROJECT_NAME}")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fpie -Winline -Werror -fno-builtin-malloc -fno-omit-frame-pointer -g")
-SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Winline -Werror -fno-builtin-malloc -fno-omit-frame-pointer -g")
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
 
@@ -67,6 +66,7 @@ ADD_DEFINITIONS("-DDEFAULT_MASTER_CONF=\"/usr/share/data-provider-master/conf.in
 ADD_DEFINITIONS("-DNDEBUG")
 
 ADD_DEFINITIONS("-D_USE_ECORE_TIME_GET")
+#ADD_DEFINITIONS("-D_APPLY_SCRIPT_ASYNC_UPDATE")
 #ADD_DEFINITIONS("-DFLOG")
 ADD_DEFINITIONS(${pkg_CFLAGS})
 ADD_DEFINITIONS(${pkg_LDFLAGS})
index 48d2bdc..9a8e847 100644 (file)
@@ -53,6 +53,7 @@ extern FILE *__file_log_fp;
 
 #define LOG_TAG "DATA_PROVIDER_MASTER"
 
+#if defined(_ENABLE_PERF)
 #define PERF_INIT() \
        struct timeval __stv; \
        struct timeval __etv; \
@@ -71,5 +72,10 @@ extern FILE *__file_log_fp;
        timersub(&__etv, &__stv, &__rtv); \
        DbgPrint("[%s] %u.%06u\n", tag, __rtv.tv_sec, __rtv.tv_usec); \
 } while (0)
+#else
+#define PERF_INIT()
+#define PERF_BEGIN()
+#define PERF_MARK(tag)
+#endif
 
 /* End of a file */
diff --git a/packaging/data-provider-master.changes b/packaging/data-provider-master.changes
new file mode 100644 (file)
index 0000000..5e22b27
--- /dev/null
@@ -0,0 +1,8 @@
+* Wed Sep 11 2013 Rusty Lynch <rusty.lynch@intel.com> accepted/tizen/20130620.160431@d15ede1
+- Add support for systemd socket activation for notification service
+
+* Thu Jun 20 2013 Victor Hakoun <victor.hakoun@eurogiciel.fr> accepted/tizen/20130620.115235@e8bd452
+- Replace manifest with default floor
+
+* Fri Jun 07 2013 Victor Hakoun <victor.hakoun@eurogiciel.fr> accepted/tizen/20130530.164904@68752b5
+- Fix build x86_64
index 1875cc5..04cf59a 100644 (file)
@@ -1,6 +1,6 @@
 Name: data-provider-master
-Summary: Master service provider for liveboxes.
-Version: 0.25.16
+Summary: Master service provider for liveboxes
+Version: 0.25.17
 Release: 1
 Group: HomeTF/Livebox
 License: Flora License
@@ -62,7 +62,7 @@ export LIVEBOX_SHM=baltic
 export LIVEBOX_SHM=private
 %endif
 
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DPRODUCT=${LIVEBOX_SHM} -DENGINEER_BINARY=${ENGINEER}
+%cmake . -DPRODUCT=${LIVEBOX_SHM} -DENGINEER_BINARY=${ENGINEER}
 
 CFLAGS="${CFLAGS} -Wall -Winline -Werror" LDFLAGS="${LDFLAGS}" make %{?jobs:-j%jobs}
 
index 0802ea0..af19f99 100644 (file)
@@ -245,7 +245,7 @@ static inline int processing_input_event(struct input_event *event)
 static void *event_thread_main(void *data)
 {
        fd_set set;
-       int ret = 0;
+       long ret = 0;
        struct input_event input_event;
        char *ptr = (char *)&input_event;
        int offset = 0;
@@ -642,7 +642,7 @@ HAPI int event_deactivate(int (*event_cb)(enum event_state state, struct event_d
        if (status != 0) {
                ErrPrint("Failed to join a thread: %s\n", strerror(errno));
        } else {
-               DbgPrint("Thread returns: %d\n", (int)ret);
+               DbgPrint("Thread returns: %p\n", ret);
        }
 
        if (close(s_info.handle) < 0) {
index 4eea26c..7cec087 100644 (file)
--- a/src/io.c
+++ b/src/io.c
@@ -823,7 +823,7 @@ static inline int db_init(void)
        int ret;
        struct stat stat;
 
-       ret = db_util_open(DBFILE, &s_info.handle, DB_UTIL_REGISTER_HOOK_METHOD);
+       ret = db_util_open_with_options(DBFILE, &s_info.handle, SQLITE_OPEN_READONLY, NULL);
        if (ret != SQLITE_OK) {
                ErrPrint("Failed to open a DB\n");
                return LB_STATUS_ERROR_IO;
index 108942b..a7633bd 100644 (file)
 static Eina_List *s_list;
 int errno;
 
+#if __x86__64__
+#define RETURN_TYPE long long
+#else
+#define RETURN_TYPE int
+#endif
+
 struct parser {
        char *filename;
        double period;
@@ -157,7 +163,7 @@ HAPI int parser_buffer_pd(struct parser *handle)
        return handle->buffer_pd;
 }
 
-HAPI int parser_find(const char *pkgname)
+HAPI RETURN_TYPE parser_find(const char *pkgname)
 {
        Eina_List *l;
        struct parser *item;
@@ -169,13 +175,13 @@ HAPI int parser_find(const char *pkgname)
 
        filename = malloc(len);
        if (!filename) {
-               return LB_STATUS_SUCCESS;
+               return (RETURN_TYPE)0;
        }
 
        ret = snprintf(filename, len, CONF_PATH, pkgname, pkgname);
        if (ret < 0) {
                DbgFree(filename);
-               return LB_STATUS_ERROR_FAULT;
+               return (RETURN_TYPE)0;
        }
 
        DbgPrint("Conf file %s for package %s\n", filename, pkgname);
@@ -183,12 +189,12 @@ HAPI int parser_find(const char *pkgname)
        EINA_LIST_FOREACH(s_list, l, item) {
                if (!strcmp(item->filename, filename)) {
                        DbgFree(filename);
-                       return (int)item;
+                       return (RETURN_TYPE)item;
                }
        }
 
        DbgFree(filename);
-       return LB_STATUS_SUCCESS;
+       return (RETURN_TYPE)0;
 }
 
 static inline int parse_size(const char *buffer, unsigned int *size)
index e5feac8..a4af88c 100644 (file)
@@ -372,8 +372,8 @@ static inline void delete_block(struct block *block)
 
 static void render_pre_cb(void *data, Evas *e, void *event_info)
 {
-       //PERF_INIT();
-       //PERF_BEGIN();
+       PERF_INIT();
+       PERF_BEGIN();
        struct inst_info *inst = data;
        struct script_info *info;
 
@@ -394,14 +394,14 @@ static void render_pre_cb(void *data, Evas *e, void *event_info)
 
        ErrPrint("Failed to do sync\n");
 out:
-       //PERF_MARK("render,pre");
+       PERF_MARK("render,pre");
        return;
 }
 
 static void render_post_cb(void *data, Evas *e, void *event_info)
 {
-       //PERF_INIT();
-       //PERF_BEGIN();
+       PERF_INIT();
+       PERF_BEGIN();
        struct inst_info *inst;
        struct script_info *info;
 
@@ -417,7 +417,7 @@ static void render_post_cb(void *data, Evas *e, void *event_info)
                fb_sync(script_handler_fb(info));
                instance_lb_updated_by_instance(inst, NULL);
 
-               //PERF_MARK("lb,update");
+               PERF_MARK("lb,update");
                return;
        }
 
@@ -425,7 +425,7 @@ static void render_post_cb(void *data, Evas *e, void *event_info)
        if (info && script_handler_evas(info) == e) {
                fb_sync(script_handler_fb(info));
                instance_pd_updated_by_instance(inst, NULL);
-               //PERF_MARK("pd,update");
+               PERF_MARK("pd,update");
                return;
        }
 
@@ -673,8 +673,8 @@ HAPI void *script_handler_evas(struct script_info *info)
 
 static int update_script_color(struct inst_info *inst, struct block *block, int is_pd)
 {
-       //PERF_INIT();
-       //PERF_BEGIN();
+       PERF_INIT();
+       PERF_BEGIN();
        struct script_info *info;
        Evas *e;
 
@@ -700,15 +700,15 @@ static int update_script_color(struct inst_info *inst, struct block *block, int
        } else {
                ErrPrint("Evas(nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data);
        }
-       //PERF_MARK("color");
+       PERF_MARK("color");
 
        return LB_STATUS_SUCCESS;
 }
 
 static int update_script_text(struct inst_info *inst, struct block *block, int is_pd)
 {
-       //PERF_INIT();
-       //PERF_BEGIN();
+       PERF_INIT();
+       PERF_BEGIN();
        struct script_info *info;
        Evas *e;
 
@@ -735,14 +735,14 @@ static int update_script_text(struct inst_info *inst, struct block *block, int i
                ErrPrint("Evas(nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data);
        }
 
-       //PERF_MARK("text");
+       PERF_MARK("text");
        return LB_STATUS_SUCCESS;
 }
 
 static int update_script_image(struct inst_info *inst, struct block *block, int is_pd)
 {
-       //PERF_INIT();
-       //PERF_BEGIN();
+       PERF_INIT();
+       PERF_BEGIN();
        struct script_info *info;
        Evas *e;
 
@@ -768,14 +768,14 @@ static int update_script_image(struct inst_info *inst, struct block *block, int
        } else {
                ErrPrint("Evas: (nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data);
        }
-       //PERF_MARK("image");
+       PERF_MARK("image");
        return LB_STATUS_SUCCESS;
 }
 
 static int update_access(struct inst_info *inst, struct block *block, int is_pd)
 {
-       //PERF_INIT();
-       //PERF_BEGIN();
+       PERF_INIT();
+       PERF_BEGIN();
        struct script_info *info;
        Evas *e;
 
@@ -801,14 +801,14 @@ static int update_access(struct inst_info *inst, struct block *block, int is_pd)
        } else {
                ErrPrint("Evas: (nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data);
        }
-       //PERF_MARK("access");
+       PERF_MARK("access");
        return LB_STATUS_SUCCESS;
 }
 
 static int operate_access(struct inst_info *inst, struct block *block, int is_pd)
 {
-       //PERF_INIT();
-       //PERF_BEGIN();
+       PERF_INIT();
+       PERF_BEGIN();
        struct script_info *info;
        Evas *e;
 
@@ -834,14 +834,14 @@ static int operate_access(struct inst_info *inst, struct block *block, int is_pd
        } else {
                ErrPrint("Evas: (nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data);
        }
-       //PERF_MARK("operate_access");
+       PERF_MARK("operate_access");
        return LB_STATUS_SUCCESS;
 }
 
 static int update_script_script(struct inst_info *inst, struct block *block, int is_pd)
 {
-       //PERF_INIT();
-       //PERF_BEGIN();
+       PERF_INIT();
+       PERF_BEGIN();
        struct script_info *info;
        Evas *e;
 
@@ -868,14 +868,14 @@ static int update_script_script(struct inst_info *inst, struct block *block, int
                ErrPrint("Evas: (nil) id[%s] part[%s] data[%s] option[%s]\n",
                                                block->id, block->part, block->data, block->option);
        }
-       //PERF_MARK("script");
+       PERF_MARK("script");
        return LB_STATUS_SUCCESS;
 }
 
 static int update_script_signal(struct inst_info *inst, struct block *block, int is_pd)
 {
-       //PERF_INIT();
-       //PERF_BEGIN();
+       PERF_INIT();
+       PERF_BEGIN();
        struct script_info *info;
        Evas *e;
 
@@ -901,14 +901,14 @@ static int update_script_signal(struct inst_info *inst, struct block *block, int
        } else {
                ErrPrint("Evas(nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data);
        }
-       //PERF_MARK("signal");
+       PERF_MARK("signal");
        return LB_STATUS_SUCCESS;
 }
 
 static int update_script_drag(struct inst_info *inst, struct block *block, int is_pd)
 {
-       //PERF_INIT();
-       //PERF_BEGIN();
+       PERF_INIT();
+       PERF_BEGIN();
        struct script_info *info;
        double dx, dy;
        Evas *e;
@@ -940,14 +940,14 @@ static int update_script_drag(struct inst_info *inst, struct block *block, int i
        } else {
                ErrPrint("Evas(nil) id[%s] part[%s] %lfx%lf\n", block->id, block->part, dx, dy);
        }
-       //PERF_MARK("drag");
+       PERF_MARK("drag");
        return LB_STATUS_SUCCESS;
 }
 
 HAPI int script_handler_resize(struct script_info *info, int w, int h)
 {
-       //PERF_INIT();
-       //PERF_BEGIN();
+       PERF_INIT();
+       PERF_BEGIN();
        if (!info) {
        //|| (info->w == w && info->h == h)) {
                ErrPrint("info[%p] resize is ignored\n", info);
@@ -976,15 +976,15 @@ HAPI int script_handler_resize(struct script_info *info, int w, int h)
 
        info->w = w;
        info->h = h;
-       //PERF_MARK("resize");
+       PERF_MARK("resize");
 
        return LB_STATUS_SUCCESS;
 }
 
 static int update_info(struct inst_info *inst, struct block *block, int is_pd)
 {
-       //PERF_INIT();
-       //PERF_BEGIN();
+       PERF_INIT();
+       PERF_BEGIN();
        struct script_info *info;
 
        if (!block || !block->part || !block->data) {
@@ -1031,7 +1031,7 @@ static int update_info(struct inst_info *inst, struct block *block, int is_pd)
                        ErrPrint("Evas(nil): id[%s] data[%s]\n", block->id, block->data);
                }
        }
-       //PERF_MARK("info");
+       PERF_MARK("info");
 
        return LB_STATUS_SUCCESS;
 }
@@ -1068,7 +1068,6 @@ static inline void consuming_parsed_block(struct inst_info *inst, int is_pd, str
        } else {
                info->cached_blocks = eina_list_append(info->cached_blocks, block);
                DbgPrint("Block is cached (%p), %d, %s\n", block, eina_list_count(info->cached_blocks), instance_id(inst));
-               //PERF_MARK(type_list[block->type]);
                return;
        }
 
@@ -1230,8 +1229,8 @@ static Eina_Bool apply_changes_cb(void *_data)
 
 HAPI int script_handler_parse_desc(struct inst_info *inst, const char *filename, int is_pd)
 {
-       //PERF_INIT();
-       //PERF_BEGIN();
+       PERF_INIT();
+       PERF_BEGIN();
        int type_idx = 0;
        int type_len = 0;
        int field_idx = 0;
@@ -1499,7 +1498,7 @@ HAPI int script_handler_parse_desc(struct inst_info *inst, const char *filename,
                block->filebuf = filebuf;
        }
 
-       //PERF_MARK("parser");
+       PERF_MARK("parser");
 
 #if defined(_APPLY_SCRIPT_ASYNC_UPDATE)
        struct apply_data *data;
index 9594705..d48e013 100644 (file)
@@ -112,7 +112,7 @@ static void *client_packet_pump_main(void *data)
        int packet_offset = 0;
        int recv_offset = 0;
        int pid;
-       int ret;
+       long ret;
        int fd;
        char evt_ch = EVT_CH;
        enum {
@@ -395,7 +395,7 @@ static inline void tcb_teminate_all(struct service_context *svc_ctx)
                if (status != 0) {
                        ErrPrint("Unable to join a thread: %s\n", strerror(status));
                } else {
-                       DbgPrint("Thread returns: %d\n", (int)ret);
+                       DbgPrint("Thread returns: %p\n", ret);
                }
 
                secure_socket_destroy_handle(tcb->fd);
@@ -430,7 +430,7 @@ static inline void tcb_destroy(struct service_context *svc_ctx, struct tcb *tcb)
        if (status != 0) {
                ErrPrint("Unable to join a thread: %s\n", strerror(status));
        } else {
-               DbgPrint("Thread returns: %d\n", (int)ret);
+               DbgPrint("Thread returns: %p\n", ret);
        }
 
        secure_socket_destroy_handle(tcb->fd);
@@ -532,7 +532,7 @@ static void *server_main(void *data)
        struct service_context *svc_ctx = data;
        fd_set set;
        fd_set except_set;
-       int ret;
+       long ret;
        int client_fd;
        struct tcb *tcb;
        int fd;
@@ -818,7 +818,7 @@ HAPI int service_common_destroy(struct service_context *svc_ctx)
        if (status != 0) {
                ErrPrint("Join: %s\n", strerror(status));
        } else {
-               DbgPrint("Thread returns: %d\n", (int)ret);
+               DbgPrint("Thread returns: %p\n", ret);
        }
 
        secure_socket_destroy_handle(svc_ctx->fd);
index 07e86d1..966bacc 100644 (file)
@@ -228,7 +228,7 @@ static void low_mem_cb(keynode_t *node, void *user_data)
                CRITICAL_LOG("Low memory: level %d\n", val);
                if (s_info.deactivated == 0) {
                        s_info.deactivated = 1;
-                       slave_deactivate_all(0, 1);
+                       //slave_deactivate_all(0, 1);
                        malloc_trim(0);
                        ErrPrint("Fall into the low mem status\n");
                }
@@ -236,7 +236,7 @@ static void low_mem_cb(keynode_t *node, void *user_data)
                CRITICAL_LOG("Normal memory: level %d\n", val);
                if (s_info.deactivated == 1) {
                        s_info.deactivated = 0;
-                       slave_activate_all();
+                       //slave_activate_all();
                        ErrPrint("Recover from the low mem status\n");
                }
        }