Print PSS usage after loading preload libraries 44/233244/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 13 May 2020 07:28:49 +0000 (16:28 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 13 May 2020 07:28:49 +0000 (16:28 +0900)
Change-Id: I48fb1ee0266ed3624302a8e0f4cfcc7e06c37c40
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/common/inc/launchpad_proc.h [moved from src/launchpad/inc/launchpad_proc.h with 100% similarity]
src/common/src/launchpad_proc.c [moved from src/launchpad/src/launchpad_proc.c with 97% similarity]
src/loader/src/launchpad_loader.c

similarity index 97%
rename from src/launchpad/src/launchpad_proc.c
rename to src/common/src/launchpad_proc.c
index daad003..e491cff 100644 (file)
@@ -107,7 +107,6 @@ int _proc_get_mem_used_ratio(unsigned int *mem_used_ratio)
 
        used = mem_total - mem_available;
        used_ratio = used * 100 / mem_total;
-       _I("memory used ratio: %u %%", used_ratio);
 
        *mem_used_ratio = used_ratio;
 
@@ -141,7 +140,6 @@ int _proc_get_mem_pss(int pid, unsigned int *mem_pss)
        }
 
        *mem_pss = total_pss;
-       _I("[%d] PSS: %u kB", pid, total_pss);
 
        return 0;
 }
index fee50e6..b67484d 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "launchpad_common.h"
 #include "launchpad_types.h"
+#include "launchpad_proc.h"
 #include "launchpad.h"
 #include "key.h"
 
@@ -150,6 +151,7 @@ static void __preload_lib(bundle *b)
        int i;
        int len = 0;
        const char **so_array;
+       unsigned int mem_pss = 0;
 
        if (!b)
                return;
@@ -159,6 +161,8 @@ static void __preload_lib(bundle *b)
        if (!so_array)
                return;
 
+       _proc_get_mem_pss(getpid(), &mem_pss);
+       _W("PSS: %u kB", mem_pss);
        for (i = 0; i < len; i++) {
                if (!so_array[i]) {
                        _E("so_array[%d] is nullptr", i);
@@ -174,7 +178,9 @@ static void __preload_lib(bundle *b)
                        _E("failed to load: %s, err: %s",
                                so_array[i], dlerror());
                } else {
-                       _D("preload %s# - handle : %p", so_array[i], handle);
+                       _proc_get_mem_pss(getpid(), &mem_pss);
+                       _W("preload %s# - handle : %p, PSS: %u kB",
+                                       so_array[i], handle, mem_pss);
                }
        }
 }