From cb7489396614061c27c36fa394b128006fdd5c2e Mon Sep 17 00:00:00 2001 From: "jy910.yun" Date: Fri, 10 May 2013 16:56:15 +0900 Subject: [PATCH] rearrange wrong error log and delete redundant log regarding proc handler Change-Id: I507f6410306cd0879d3ea7e47b30253914f83ed6 Signed-off-by: jy910.yun --- src/proc/lowmem-handler.c | 22 +++++++++------------- src/proc/pmon-handler.c | 32 ++++++++++++++++---------------- src/proc/proc-handler.c | 10 ++++------ 3 files changed, 29 insertions(+), 35 deletions(-) diff --git a/src/proc/lowmem-handler.c b/src/proc/lowmem-handler.c index d486fb4..ebb3de3 100644 --- a/src/proc/lowmem-handler.c +++ b/src/proc/lowmem-handler.c @@ -101,8 +101,7 @@ static int remove_shm() if (shmid < 0) continue; if (shmseg.shm_nattch == 0) { - _D("shared memory killer ==> %d killed", - shmid); + _D("shared memory killer ==> %d killed", shmid); shmctl(shmid, IPC_RMID, NULL); } } @@ -215,7 +214,7 @@ static int memory_low_act(void *data) { char lowmem_noti_name[NAME_MAX]; - _D("[LOW MEM STATE] memory low state"); + _I("[LOW MEM STATE] memory low state"); make_LMM_log("/var/log/memps", 1, "LOWMEM_WARNING"); remove_shm(); heynoti_get_snoti_name(_SYS_RES_CLEANUP, lowmem_noti_name, NAME_MAX); @@ -231,7 +230,7 @@ static int memory_oom_act(void *data) unsigned int cur_time; char lowmem_noti_name[NAME_MAX]; - _D("[LOW MEM STATE] memory oom state"); + _I("[LOW MEM STATE] memory oom state"); cur_time = time(NULL); _D("cur=%d, old=%d, cur-old=%d", cur_time, oom_delete_sm_time, cur_time - oom_delete_sm_time); @@ -248,13 +247,12 @@ static int memory_oom_act(void *data) vconf_set_int(VCONFKEY_SYSMAN_LOW_MEMORY, VCONFKEY_SYSMAN_LOW_MEMORY_HARD_WARNING); - return 1; } static int memory_normal_act(void *data) { - _D("[LOW MEM STATE] memory normal state"); + _I("[LOW MEM STATE] memory normal state"); vconf_set_int(VCONFKEY_SYSMAN_LOW_MEMORY, VCONFKEY_SYSMAN_LOW_MEMORY_NORMAL); return 0; @@ -272,7 +270,7 @@ static int lowmem_process(unsigned int mem_state, void *ad) oom_timer = NULL; } lpe[i].action(ad); - if(mem_state == MEMNOTIFY_CRITICAL) + if(mem_state == MEMNOTIFY_CRITICAL) oom_timer = ecore_timer_add(OOM_TIMER_INTERVAL,lpe[i].action, ad); return 0; } @@ -296,14 +294,13 @@ static int lowmem_cb(void *data, Ecore_Fd_Handler * fd_handler) unsigned int mem_state; if (!ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ)) { - _E - ("ecore_main_fd_handler_active_get error , return\n"); + _E("ecore_main_fd_handler_active_get error, return"); return -1; } fd = ecore_main_fd_handler_fd_get(fd_handler); if (fd < 0) { - _E("ecore_main_fd_handler_fd_get error , return"); + _E("ecore_main_fd_handler_fd_get error, return"); return -1; } mem_state = lowmem_read(fd); @@ -405,8 +402,7 @@ int lowmem_def_predefine_action(int argc, char **argv) if (pid > 0 && pid != get_exec_pid(LOWMEM_EXEC_PATH) && pid != get_exec_pid(MEMPS_EXEC_PATH)) { if ((get_cmdline_name(pid, appname, PATH_MAX)) == 0) { - _E("we will kill, lowmem lv2 = %d (%s)\n", - pid, appname); + _E("we will kill, lowmem lv2 = %d (%s)", pid, appname); make_memps_log(MEMPS_LOG_FILE, pid, appname); if(get_app_oomadj(pid, &oom_adj) < 0) { @@ -427,7 +423,7 @@ int lowmem_def_predefine_action(int argc, char **argv) ret = syspopup_launch("lowmem-syspopup", b); bundle_free(b); if (ret < 0) { - _E("popup lauch failed\n"); + _E("popup lauch failed"); return -1; } diff --git a/src/proc/pmon-handler.c b/src/proc/pmon-handler.c index 3b6aa29..33b6d7f 100644 --- a/src/proc/pmon-handler.c +++ b/src/proc/pmon-handler.c @@ -98,16 +98,16 @@ static int pmon_process(int pid, void *ad) int r; if (is_vip(pid)) { - _E("======================================="); - _E("[Process MON] VIP process dead."); - _E("======================================="); + _I("======================================="); + _I("[Process MON] VIP process dead."); + _I("======================================="); } /* If there is NOT a .hibernation_start file, run following codes * On hibernation processing, just ignore relaunching */ else if (access("/tmp/.hibernation_start", R_OK) != 0) { cmdline = pmon_get_permanent_pname(pid); if (cmdline != NULL) { - _D("[Process MON] %s relaunch", cmdline); + _I("[Process MON] %s relaunch", cmdline); new_pid = ss_launch_evenif_exist(cmdline, ""); free(cmdline); if (new_pid > 0) { @@ -117,10 +117,10 @@ static int pmon_process(int pid, void *ad) int cnt; if (access(PMON_PERMANENT_DIR, R_OK) < 0) { - _D("no predefined matrix dir = %s, so created", PMON_PERMANENT_DIR); + _I("no predefined matrix dir = %s, so created", PMON_PERMANENT_DIR); r = mkdir(PMON_PERMANENT_DIR, 0777); if(r < 0) { - _D("Make Directory is failed"); + _E("Make Directory is failed"); return -1; } } @@ -128,14 +128,14 @@ static int pmon_process(int pid, void *ad) snprintf(filepath, sizeof(filepath), "%s/%d", PMON_PERMANENT_DIR, pid); fd = open(filepath, O_RDONLY); if (fd == -1) { - _D("Failed to open"); + _E("Failed to open"); return -1; } cnt = read(fd, buf, PATH_MAX); close(fd); if (cnt <= 0) { - _D("Failed to read"); + _E("Failed to read"); return -1; } @@ -143,11 +143,11 @@ static int pmon_process(int pid, void *ad) fd = open(filepath, O_CREAT | O_WRONLY, 0644); if (fd == -1) { - _D("Failed to open"); + _E("Failed to open"); return -1; } if (write(fd, buf, cnt) == -1) { - _D("Failed to write"); + _E("Failed to write"); close(fd); return -1; } @@ -155,13 +155,13 @@ static int pmon_process(int pid, void *ad) if ( device_set_property(DEVICE_TYPE_PROCESS, PROP_PROCESS_MP_PNP, new_pid) < 0) { _E("Write new pid failed"); } - _D("[Process MON] %d ", new_pid); + _I("[Process MON] %d ", new_pid); FILE *fp; - _D("[Process MON] OOMADJ_SET : pid %d, new_oomadj %d", + _I("[Process MON] OOMADJ_SET : pid %d, new_oomadj %d", new_pid, (-17)); - + fp = open_proc_oom_adj_file(new_pid, "w"); if (fp == NULL) return -1; @@ -171,8 +171,8 @@ static int pmon_process(int pid, void *ad) snprintf(old_file, sizeof(old_file), "%s/%d", PMON_PERMANENT_DIR, pid); unlink(old_file); - } else { - _E("[Process MON] failed relaunching"); + } else { + _I("[Process MON] failed relaunching"); } } } @@ -209,7 +209,7 @@ static int pmon_cb(void *data, Ecore_Fd_Handler * fd_handler) __pmon_start(ad); return -1; } - + print_pmon_state(dead_pid); pmon_process(dead_pid, ad); diff --git a/src/proc/proc-handler.c b/src/proc/proc-handler.c index 522a79d..02c7243 100644 --- a/src/proc/proc-handler.c +++ b/src/proc/proc-handler.c @@ -84,14 +84,12 @@ int set_app_oomadj(pid_t pid, int new_oomadj) } old_oomadj = atoi(buf); fclose(fp); - _E("Process %s, pid %d, old_oomadj %d", exe_name, pid, - old_oomadj); + _I("Process %s, pid %d, old_oomadj %d", exe_name, pid, old_oomadj); if (old_oomadj < OOMADJ_APP_LIMIT) return 0; - _E("Process %s, pid %d, new_oomadj %d", exe_name, pid, - new_oomadj); + _I("Process %s, pid %d, new_oomadj %d", exe_name, pid, new_oomadj); snprintf(buf, sizeof(buf), "/proc/%d/oom_adj", pid); fp = fopen(buf, "w"); if (fp == NULL) @@ -127,8 +125,8 @@ int set_oomadj_action(int argc, char **argv) char buf[255]; FILE *fp; + _I("OOMADJ_SET : pid %d, new_oomadj %d", pid, new_oomadj); - _E("OOMADJ_SET : pid %d, new_oomadj %d", pid, new_oomadj); snprintf(buf, sizeof(buf), "/proc/%d/oom_adj", pid); fp = fopen(buf, "w"); if (fp == NULL) @@ -409,7 +407,7 @@ int set_process_group_action(int argc, char **argv) ret = device_set_property(DEVICE_TYPE_PROCESS, PROP_PROCESS_MP_PNP, pid); if (ret == 0) - _E("%s : pid %d", argv[1], pid); + _I("%s : pid %d", argv[1], pid); else _E("fail to set %s : pid %d",argv[1], pid); return 0; -- 2.7.4