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);
}
}
{
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);
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);
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;
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;
}
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);
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) {
ret = syspopup_launch("lowmem-syspopup", b);
bundle_free(b);
if (ret < 0) {
- _E("popup lauch failed\n");
+ _E("popup lauch failed");
return -1;
}
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) {
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;
}
}
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;
}
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;
}
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;
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");
}
}
}
__pmon_start(ad);
return -1;
}
-
+
print_pmon_state(dead_pid);
pmon_process(dead_pid, ad);
}
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)
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)
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;