Disable muse log at TV profile because of abnormal operation and performance issue 80/91880/8 accepted/tizen/common/20161013.155912 accepted/tizen/ivi/20161013.072919 accepted/tizen/mobile/20161013.072828 accepted/tizen/tv/20161013.072844 accepted/tizen/wearable/20161013.072859 submit/tizen/20161012.232049
authorYoungHun Kim <yh8004.kim@samsung.com>
Wed, 12 Oct 2016 05:20:46 +0000 (14:20 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Wed, 12 Oct 2016 08:45:15 +0000 (17:45 +0900)
Change-Id: Ia8f5712ecf9b6c15b6ad0dc0e3ce51afa68e0a00

packaging/mused.spec
src/muse_core_ipc.c
src/muse_core_log.c
src/muse_core_msg_json.c
src/muse_core_server.c

index 7cbd042..c024b55 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mused
 Summary:    A Multimedia Daemon in Tizen Native API
-Version:    0.1.18
+Version:    0.1.19
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
@@ -71,6 +71,7 @@ cp muse-server %{buildroot}/usr/bin
 %make_install
 
 %if "%{?profile}" == "tv"
+export CFLAGS+=" -DMUSE_TV_PROFILE"
 %if ("%{VD_PRODUCT_TYPE}" == "AUDIO")
 mkdir -p %{buildroot}%{_unitdir}/stater.target.wants
 install -m 0644 %SOURCE5 %{buildroot}%{_unitdir}/muse-server.service
index b76ead0..46d9a99 100644 (file)
@@ -62,7 +62,9 @@ static void _muse_core_ipc_client_cleanup(muse_module_h module)
 {
        g_return_if_fail(module != NULL);
 
+#ifndef MUSE_TV_PROFILE
        muse_core_log_get_instance()->flush_msg();
+#endif
 
        g_queue_free(module->ch[MUSE_CHANNEL_DATA].queue);
        module->ch[MUSE_CHANNEL_DATA].queue = NULL;
@@ -106,7 +108,9 @@ static gpointer _muse_core_ipc_dispatch_worker(gpointer data)
                        api_module = 0;
                        module->msg_offset = 0;
 
+#ifndef MUSE_TV_PROFILE
                        muse_core_log_get_instance()->log(module->recvMsg);
+#endif
 
                        while (module->msg_offset < len) {
                                if (muse_core_msg_json_deserialize(MUSE_API, module->recvMsg + module->msg_offset, &parse_len, &cmd, &err, MUSE_TYPE_INT)) {
@@ -451,7 +455,10 @@ int muse_core_ipc_send_fd_msg(int sock_fd, int fd, const char *buf)
        char err_msg[MAX_ERROR_MSG_LEN] = {'\0',};
 
        g_return_val_if_fail(buf != NULL, MM_ERROR_INVALID_ARGUMENT);
+
+#ifndef MUSE_TV_PROFILE
        muse_core_log_get_instance()->log((char*)buf);
+#endif
 
        memset(&iov, 0, sizeof(iov));
        iov.iov_base = (void*)buf;
index fbda09c..b89eb0e 100644 (file)
@@ -383,6 +383,7 @@ static void _muse_core_log_attributes(const char *msg, ...)
 
 static void _muse_core_log_monitor(char *msg)
 {
+#ifndef MUSE_TV_PROFILE
        g_return_if_fail(msg != NULL);
        g_return_if_fail(g_muse_core_log != NULL);
 
@@ -399,6 +400,7 @@ static void _muse_core_log_monitor(char *msg)
                        _muse_core_log_write_buffer(msg, strlen(msg));
                }
        }
+#endif
 }
 
 static void _muse_core_log_fatal(char *msg)
@@ -422,6 +424,7 @@ static void _muse_core_log_free(void)
 
 static void _muse_core_log_set_msg(char *msg)
 {
+#ifndef MUSE_TV_PROFILE
        g_return_if_fail(g_muse_core_log != NULL);
        g_return_if_fail(msg != NULL);
 
@@ -431,6 +434,7 @@ static void _muse_core_log_set_msg(char *msg)
 
        memcpy(g_muse_core_log->buf, msg, size);
        memcpy(g_muse_core_log->buf + size, "\0", 1);
+#endif
 }
 
 static char *_muse_core_log_get_msg(void)
@@ -443,8 +447,10 @@ static char *_muse_core_log_get_msg(void)
 
 static void _muse_core_log_flush_msg(void)
 {
+#ifndef MUSE_TV_PROFILE
        if (write(g_muse_core_log->log_fd, g_muse_core_log->cache, strlen(g_muse_core_log->cache)) != (int)strlen(g_muse_core_log->cache))
                LOGE("There was an error writing to logfile");
+#endif
 }
 
 muse_core_log_t *muse_core_log_get_instance(void)
@@ -458,6 +464,7 @@ muse_core_log_t *muse_core_log_get_instance(void)
 
 void muse_core_log_init(void)
 {
+#ifndef MUSE_TV_PROFILE
        LOGD("Enter");
 
        if (g_muse_core_log == NULL)
@@ -468,4 +475,5 @@ void muse_core_log_init(void)
        _muse_core_log_init_signals();
 
        LOGD("Leave");
+#endif
 }
index 92269c5..acc586e 100644 (file)
@@ -151,7 +151,10 @@ char *muse_core_msg_json_factory_new(int api, ...)
 
        jsonMsg = json_object_to_json_string(jobj);
        sndMsg = g_strdup(jsonMsg);
+
+#ifndef MUSE_TV_PROFILE
        muse_core_log_get_instance()->set_msg(sndMsg);
+#endif
 
        json_object_put(jobj);
 
index 1ad0541..5021702 100644 (file)
@@ -126,12 +126,14 @@ int main(int argc, char **argv)
                exit(0);
        }
 
+#ifndef MUSE_TV_PROFILE
        /* create new session */
        muse_core_log_get_instance()->pid = setsid();
        if (muse_core_log_get_instance()->pid < 0) {
                LOGE("SID : %d, PID CLOSE!!", muse_core_log_get_instance()->pid);
                exit(0);
        }
+#endif
 
        /* Change the file mode mask */
        umask(0);