Revise the cpu usage 72/235272/2
authorYoungHun Kim <yh8004.kim@samsung.com>
Wed, 3 Jun 2020 08:37:03 +0000 (17:37 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Wed, 3 Jun 2020 08:54:36 +0000 (17:54 +0900)
Change-Id: I52a833c55dc758dbfc23ba797e68cce184c24ee5

core/src/muse_core.c
packaging/mused.spec

index 92cd6d6..2707e1b 100644 (file)
@@ -797,7 +797,6 @@ int muse_core_get_process_cpu_usage(int pid)
 {
        FILE *fp = NULL;
        int cpu = 0;
-       int idx = 0;
        char cmd[MUSE_MSG_LEN_MAX];
        char buf[MUSE_MSG_LEN_MAX];
 
@@ -808,8 +807,7 @@ int muse_core_get_process_cpu_usage(int pid)
        if (fp) {
                while (fgets(buf, MUSE_MSG_LEN_MAX, fp)) {
                        LOGW("%s", buf);
-                       if (idx++ == 1)
-                               cpu = atoi(g_strstrip(buf));
+                       cpu += atoi(g_strstrip(buf));
                }
 
                if (pclose(fp) == -1)
index 5200dcf..48c7f8b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mused
 Summary:    A multimedia daemon
-Version:    0.3.115
+Version:    0.3.116
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0