Monitoring the crashes from the callback of the livebox.
authorSung-jae Park <nicesj.park@samsung.com>
Wed, 30 May 2012 11:33:56 +0000 (20:33 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Wed, 30 May 2012 15:05:56 +0000 (00:05 +0900)
Change-Id: Icee9442de65d3a5cd016e0637dadfb9342df3f2d

debian/changelog
include/conf.h
include/util.h
packaging/com.samsung.data-provider-slave.spec
src/dbus.c
src/livebox.c
src/util.c

index 930082c..8eaf5a1 100644 (file)
@@ -1,3 +1,10 @@
+data-provider-slave (0.0.6) unstable; urgency=low
+
+  * Git: slp/pkgs/d/data-provider-slave
+  * Tag: data-provider-slave_0.0.6
+
+ -- Sung-jae Park <nicesj.park@samsung.com>  Wed, 30 May 2012 20:34:23 +0900
+
 data-provider-slave (0.0.5) unstable; urgency=low
 
   * Git: slp/pkgs/d/data-provider-slave
index 84c6de5..ec1d46d 100644 (file)
@@ -53,7 +53,7 @@ extern void conf_init(void);
 #define DEFAULT_UPDATE_TIMEOUT 7
 #define BASE_W 720
 #define BASE_H 1280
-#define MINIMUM_UPDATE_INTERVAL        0.1f
+#define MINIMUM_UPDATE_INTERVAL        0.5f
 
 #define CR 13
 
index 7afe0a3..6bc430a 100644 (file)
@@ -21,7 +21,6 @@
 
 extern int util_get_pkgname(Ecore_X_Window win, char *pkgname, int size);
 extern int util_check_ext(const char *icon, const char *ext);
-extern int util_unlink(const char *filename);
 extern double util_get_timestamp(void);
 
 /* End of a file */
index a5f7738..aca9f48 100644 (file)
@@ -1,6 +1,6 @@
 Name: com.samsung.data-provider-slave
 Summary: Slave data provider
-Version: 0.0.4
+Version: 0.0.6
 Release: 1
 Group: main/app
 License: Samsung Proprietary License
index d8b3f7a..bb41867 100644 (file)
@@ -322,8 +322,6 @@ static void method_pause(GDBusMethodInvocation *inv, GVariant *param)
 
        g_variant_get(param, "(d)", &timestamp);
 
-       DbgPrint("Pause at %lf\n", timestamp);
-
        param = g_variant_new("(i)", 0);
        g_dbus_method_invocation_return_value(inv, param);
 
@@ -336,8 +334,6 @@ static void method_resume(GDBusMethodInvocation *inv, GVariant *param)
 
        g_variant_get(param, "(d)", &timestamp);
 
-       DbgPrint("Resume at %lf\n", timestamp);
-
        param = g_variant_new("(i)", 0);
        g_dbus_method_invocation_return_value(inv, param);
 
@@ -419,7 +415,7 @@ static void method_new(GDBusMethodInvocation *inv, GVariant *param)
 
        /* TODO: timeout, livebox_script, period */
        ret = livebox_create(pkgname, filename, content, timeout, has_livebox_script, period, cluster, category, &w, &h, &priority, pinup, skip_need_to_create, abi);
-       DbgPrint("Recreate livebox: pkgname[%s], filename[%s], content[%s]" \
+       DbgPrint("Create livebox: pkgname[%s], filename[%s], content[%s]" \
                ", timeout[%d]" \
                ", has_livebox_script[%d]" \
                ", period[%lf]" \
index bad598f..1e3d74c 100644 (file)
@@ -62,6 +62,7 @@ static inline void update_monitor_cnt(struct item *item)
         * And handling this heavy updating from the
         * file update callback.
         */
+       DbgPrint("Update interval: %lf\n", interval);
        if (interval >= MINIMUM_UPDATE_INTERVAL)
                item->monitor_cnt++;
        else
@@ -98,6 +99,7 @@ static inline int output_handler(struct item *item)
        DbgPrint("monitor_cnt: %d\n", item->monitor_cnt);
 
        if (item->monitor_cnt == 0) {
+               fault_unmark_call(item->inst->item->pkgname, item->inst->filename, "update,crashed");
                if (item->monitor) {
                        DbgPrint("Destroy monitor: %p\n", item->monitor);
                        ecore_timer_del(item->monitor);
@@ -225,6 +227,7 @@ static Eina_Bool update_timeout_cb(void *data)
        if (s_info.update != item)
                ErrPrint("Updating item is not matched\n");
 
+       fault_unmark_call(item->inst->item->pkgname, item->inst->filename, "update,crashed");
        fault_mark_call(item->inst->item->pkgname, item->inst->filename, "update,timeout");
        s_info.update = NULL;
 
@@ -273,7 +276,14 @@ static Eina_Bool updator_cb(void *data)
        item->monitor_cnt = 1;
 
        s_info.update = item;
+
        ret = so_update(item->inst);
+       /*!
+        * \note
+        * While waiting the Callback function call,
+        * Add this for finding the crash
+        */
+       fault_mark_call(item->inst->item->pkgname, item->inst->filename, "update,crashed");
 
        if (ret < 0) {
                item->monitor_cnt--;
index 04a4e90..235b534 100644 (file)
@@ -75,33 +75,6 @@ int util_check_ext(const char *icon, const char *ext)
        return *ext ? 0 : 1;
 }
 
-int util_unlink(const char *filename)
-{
-       char *descfile;
-       int desclen;
-
-       desclen = strlen(filename) + 6; /* .desc */
-       descfile = malloc(desclen);
-       if (descfile) {
-               int ret;
-               ret = snprintf(descfile, desclen, "%s.desc", filename);
-               if (ret < 0) {
-                       DbgPrint("Error: %s\n", strerror(errno));
-               } else {
-                       ret = unlink(descfile);
-                       if (ret < 0)
-                               DbgPrint("Unlink: %s - %s\n",
-                                       descfile, strerror(errno));
-               }
-               free(descfile);
-       }
-
-       if (unlink(filename) < 0)
-               DbgPrint("Unlink: %s - %s\n", filename, strerror(errno));
-
-       return 0;
-}
-
 double util_get_timestamp(void)
 {
        struct timeval tv;