Include more functions into the memps logging definition 59/69059/1
authorKichan Kwon <k_c.kwon@samsung.com>
Wed, 11 May 2016 08:53:25 +0000 (17:53 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Wed, 11 May 2016 08:53:25 +0000 (17:53 +0900)
Change-Id: I7049733da2dee2b7eda52c0fac06c80eb7070850
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
src/memory/vmpressure-lowmem-handler.c
src/sluggish/sluggish.c

index c479939..6d4c3c7 100644 (file)
@@ -411,6 +411,7 @@ static int get_proc_mem_usage(pid_t pid, unsigned int *usage)
        return RESOURCED_ERROR_FAIL;
 }
 
+#ifdef MEMPS_LOG
 int compare_func(const struct dirent **a, const struct dirent **b)
 {
        const char *fn_a = (*a)->d_name;
@@ -421,7 +422,6 @@ int compare_func(const struct dirent **a, const struct dirent **b)
        return strncmp(str_at, str_bt, strlen(str_bt)+1);
 }
 
-#ifdef MEMPS_LOG
 static int memps_file_select(const struct dirent *entry)
 {
    return strstr(entry->d_name, "memps") ? 1 : 0;
index 766db0a..3acf6b5 100755 (executable)
@@ -117,6 +117,7 @@ static void sluggish_get_vmstat(char *timestamp)
                _I("Copy: %s to %s SUCCESS", VMSTAT_FILE_PATH, file_name);
 }
 
+#ifdef MEMPS_LOG
 static void sluggish_get_memps(char *timestamp)
 {
        char file_name[MAX_FILENAME_LEN];
@@ -138,6 +139,7 @@ static void sluggish_get_memps(char *timestamp)
        else
                _I("Cmd: memps -a  Success");
 }
+#endif
 
 static void sluggish_get_meminfo(char *timestamp)
 {
@@ -175,7 +177,9 @@ static void sluggish_get_psinfo(char *timestamp)
 
 static const struct sluggish_stat sluggish_memstat[] = {
        { "vmstat", sluggish_get_vmstat },
+#ifdef MEMPS_LOG
        { "memps", sluggish_get_memps },
+#endif
        { "meminfo", sluggish_get_meminfo },
 };