Update to set dispatcher of disable watchdog using mused.conf 39/131039/5
authorYoungHun Kim <yh8004.kim@samsung.com>
Thu, 25 May 2017 07:08:16 +0000 (16:08 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Tue, 30 May 2017 07:45:59 +0000 (16:45 +0900)
Change-Id: I3c3ea91e895ee2c44cfb3f68580c8551a4baede3

include/muse_core_config.h
src/muse_core.c
src/muse_core_config.c
src/muse_core_module.c

index 76ccea3..3f2b4cf 100644 (file)
@@ -42,11 +42,13 @@ extern "C" {
 #define PATH "path"
 #define PRELOADED "preloaded"
 #define TIMEOUT "timeout"
+#define DIABLEWATCHDOGAPI "disable_watchdog_api"
 
 typedef struct host_info {
        char *path;
        char *preloaded;
        int timeout;
+       int disable_watchdog_api;
 } host_info_t;
 
 typedef struct muse_core_config {
index 9fb618f..3c862e8 100644 (file)
@@ -445,10 +445,9 @@ static void _muse_core_write_info(char *cmd)
 
 static void _muse_core_check_memory(pid_t pid)
 {
-       int used_pss_mb;
+       int used_pss_mb = muse_core_system_get_instance()->get_memory_info(pid);
 
        if (g_queue_is_empty(muse_core_ipc_get_instance()->module_queue)) {
-               used_pss_mb = muse_core_system_get_instance()->get_memory_info(pid);
                if (used_pss_mb > muse_core_config_get_instance()->memory_threshold) {
                        LOGE("[Memory Leak] %d > %d", used_pss_mb, muse_core_config_get_instance()->memory_threshold);
                        muse_core_log_process_info(pid);
index e289a6f..82468d9 100644 (file)
@@ -196,6 +196,12 @@ static int _muse_core_config_parser(void)
                        goto out;
                }
 
+               /* disable_watchdog_api */
+               snprintf(host_name, MUSE_MAX_MSG_LEN, "%s%s%s", host, COLON, DIABLEWATCHDOGAPI);
+
+               g_muse_core_conf->host_infos[host_cnt]->disable_watchdog_api =
+                       atoi(iniparser_getstring(g_muse_core_conf->muse_dict, host_name, NULL));
+
                host = strtok_r(NULL, COMMA, &ptr);
                g_muse_core_conf->host_cnt++;
                MUSE_FREE(host_name);
index 2454b87..f96f370 100644 (file)
@@ -91,10 +91,8 @@ static gboolean _muse_core_module_dispatch_callback(gpointer data)
 
 static gboolean _muse_core_module_enable_dispatch_callback(int cmd, muse_module_h module)
 {
-       if (module->api_module == MUSE_CAMERA || module->api_module == MUSE_RECORDER) {
-               if (cmd == API_CREATE)
-                       return FALSE;
-       }
+       if (cmd == muse_core_config_get_instance()->host_infos[module->api_module]->disable_watchdog_api)
+               return FALSE;
 
        return TRUE;
 }