error = cgroup_read_node_uint32(dir, MEMCG_LIMIT_BYTE, &prev);
if (error) {
- _E("[DEBUG] Failed to get %s from %s", MEMCG_LIMIT_BYTE, dir);
+ _E("[MEMORY-LIMIT] Failed to get %s from %s", MEMCG_LIMIT_BYTE, dir);
return;
}
if (poo == -1) {
error = fread_uint("/proc/sys/vm/panic_on_oom", &poo);
if (error) {
- _E("[DEBUG] Failed to get %s from %s", "/proc/sys/vm/panic_on_oom", dir);
+ _E("[MEMORY-LIMIT] Failed to get %s from %s", "/proc/sys/vm/panic_on_oom", dir);
return RESOURCED_ERROR_FAIL;
}
}
/* If panic_on_oom is true (> 1), turn of panic_on_oom */
if (poo != 0) {
- _I("[DEBUG] %s's value is %d. That is, kernel panic will be inevitable on %s, when oom happens", "/proc/sys/vm/panic_on_oom", poo, dir);
+ _I("[MEMORY-LIMIT] %s's value is %d. That is, kernel panic will be inevitable on %s, when oom happens", "/proc/sys/vm/panic_on_oom", poo, dir);
error = fwrite_uint("/proc/sys/vm/panic_on_oom", 0);
if (!error)
fread_uint("/proc/sys/vm/panic_on_oom", &poo);
else {
- _E("[DEBUG] Failed to update %s", "/proc/sys/vm/panic_on_oom");
+ _E("[MEMORY-LIMIT] Failed to update %s", "/proc/sys/vm/panic_on_oom");
return RESOURCED_ERROR_FAIL;
}
}
ret = cgroup_write_node_uint32(name,
MEMCG_SWAPPINESS, swappiness);
if (ret)
- _I("[DEBUG] failed to write %s %d to %s the",
+ _I("[SWAP] failed to write %s %d to %s the",
MEMCG_SWAPPINESS, swappiness, name);
}
char size;
char *ptr = strchr(value, 's');
if (ptr == NULL) {
- _E("[DEBUG] Cannot find 's' in the string (%s)", value);
+ _E("[CONFIG] Cannot find 's' in the string (%s)", value);
return 0;
}
if (value > (ptr - 1)) {
- _E("[DEBUG] Size of string should be larger than 1");
+ _E("[CONFIG] Size of string should be larger than 1");
return 0;
}
return atoi(value);
}
else {
- _E("[DEBUG] Unknown unit of time");
+ _E("[CONFIG] Unknown unit of time");
return 0;
}
}
struct swap_conf *swap_conf = get_swap_conf();
if (swap_conf == NULL) {
- _E("[DEBUG] swap configuration is NULL");
+ _E("[CONFIG] swap configuration is NULL");
return RESOURCED_ERROR_FAIL;
}
struct dedup_conf *dedup_conf = get_dedup_conf();
if (dedup_conf == NULL) {
- _E("[DEBUG] dedup configuration is NULL");
+ _E("[CONFIG] dedup configuration is NULL");
return RESOURCED_ERROR_FAIL;
}
struct compact_conf *compact_conf = get_compact_conf();
if (compact_conf == NULL) {
- _E("[DEBUG] compact configuration is NULL");
+ _E("[CONFIG] compact configuration is NULL");
return RESOURCED_ERROR_FAIL;
}
struct cpu_sched_conf *cpu_sched_conf = get_cpu_sched_conf();
if (cpu_sched_conf == NULL) {
- _E("[DEBUG] cpu_sched configuration is NULL");
+ _E("[CONFIG] cpu_sched configuration is NULL");
return RESOURCED_ERROR_FAIL;
}
!strncmp(result->value, "0", 2))
swap_conf->enable = false;
else {
- _E("[DEBUG] Unknown value for %s", result->name);
+ _E("[CONFIG] Unknown value for %s", result->name);
return RESOURCED_ERROR_FAIL;
}
}
!strncmp(result->value, "0", 2))
swap_conf->boot_reclaim_enable = false;
else {
- _E("[DEBUG] Unknown value for %s", result->name);
+ _E("[CONFIG] Unknown value for %s", result->name);
return RESOURCED_ERROR_FAIL;
}
}
else if (!strncmp(result->name, SWAP_TYPE_CONF,
strlen(SWAP_TYPE_CONF)+1)) {
if (config_parse_swap_types(result->value, &swap_conf->swap_type) < 0) {
- _E("[DEBUG] Failed to parse type of swap, so use default zram type");
+ _E("[CONFIG] Failed to parse type of swap, so use default zram type");
swap_conf->swap_type = SWAP_TYPE_ZRAM;
}
/* if (strlen(result->value) + 1 > sizeof(swap_conf->type)) {
swap_conf->swappiness[CGROUP_LOW] = atoi(result->value);
}
else {
- _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
+ _E("[CONFIG] Unknown configuration name (%s) and value (%s) on section (%s)",
result->name, result->value, result->section);
}
}
swap_conf->zram.ratio = atof(result->value);
}
else {
- _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
+ _E("[CONFIG] Unknown configuration name (%s) and value (%s) on section (%s)",
result->name, result->value, result->section);
}
}
sizeof(swap_conf->zswap.pool_type) - 1);
}
else {
- _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
+ _E("[CONFIG] Unknown configuration name (%s) and value (%s) on section (%s)",
result->name, result->value, result->section);
}
}
!strncmp(result->value, "0", 2))
dedup_conf->enable = false;
else {
- _E("[DEBUG] Unknown value for %s", result->name);
+ _E("[CONFIG] Unknown value for %s", result->name);
return RESOURCED_ERROR_FAIL;
}
}
!strncmp(result->value, "0", 2))
dedup_conf->boot_dedup_enable = false;
else {
- _E("[DEBUG] Unknown value for %s", result->name);
+ _E("[CONFIG] Unknown value for %s", result->name);
return RESOURCED_ERROR_FAIL;
}
}
!strncmp(result->value, "false", 6))
dedup_conf->scan_on_lowmem = false;
else {
- _E("[DEBUG] Unknown value for %s", result->name);
+ _E("[CONFIG] Unknown value for %s", result->name);
return RESOURCED_ERROR_FAIL;
}
}
else {
- _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
+ _E("[CONFIG] Unknown configuration name (%s) and value (%s) on section (%s)",
result->name, result->value, result->section);
}
}
dedup_conf->ksm.boost_pages = atoi(result->value);
}
else {
- _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
+ _E("[CONFIG] Unknown configuration name (%s) and value (%s) on section (%s)",
result->name, result->value, result->section);
}
}
!strncmp(result->value, "false", 6))
compact_conf->enable = false;
else {
- _E("[DEBUG] Unknown value for %s", result->name);
+ _E("[CONFIG] Unknown value for %s", result->name);
return RESOURCED_ERROR_FAIL;
}
}
compact_conf->frag_level = atoi(result->value);
}
else {
- _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
+ _E("[CONFIG] Unknown configuration name (%s) and value (%s) on section (%s)",
result->name, result->value, result->section);
}
}
cpu_sched_conf->rt_period_us = config_parse_time_us(result->value);
}
else {
- _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
+ _E("[CONFIG] Unknown configuration name (%s) and value (%s) on section (%s)",
result->name, result->value, result->section);
}
}
error = set_cpucg_conf(result->name, result->value);
}
else {
- _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
+ _E("[CONFIG] Unknown configuration name (%s) and value (%s) on section (%s)",
result->name, result->value, result->section);
}
return error;
}
else {
- _E("[DEBUG] Unknown section name (%s) and value (%s) on section (%s)",
+ _E("[CONFIG] Unknown section name (%s) and value (%s) on section (%s)",
result->name, result->value, result->section);
}
struct memcg_conf *memcg_conf = get_memcg_conf();
if (memcg_conf == NULL) {
- _E("[DEBUG] memory cgroup configuration is NULL");
+ _E("[CONFIG] memory cgroup configuration is NULL");
return RESOURCED_ERROR_FAIL;
}
strlen(MEMORY_GROUP_LIMIT_SECTION)+1)) {
char *ptr = strchr(result->value, '%');
if (ptr == NULL) {
- _E("[DEBUG] Cannot find '%%' in the string (%s)", result->value);
+ _E("[CONFIG] Cannot find '%%' in the string (%s)", result->value);
return RESOURCED_ERROR_FAIL;
}
else
memcg_conf->cgroup_limit[CGROUP_LOW] = atof(result->value);
}
else {
- _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
+ _E("[CONFIG] Unknown configuration name (%s) and value (%s) on section (%s)",
result->name, result->value, result->section);
}
}
!strncmp(result->value, "0", 2))
memcg_conf->oom_popup = false;
else {
- _E("[DEBUG] Unknown value for %s", result->name);
+ _E("[CONFIG] Unknown value for %s", result->name);
return RESOURCED_ERROR_FAIL;
}
}
if (ptr == NULL) {
ptr = strchr(result->value, 'B');
if (ptr == NULL) {
- _E("[DEBUG] Cannot find 'B' in the string (%s)", result->value);
+ _E("[CONFIG] Cannot find 'B' in the string (%s)", result->value);
return RESOURCED_ERROR_FAIL;
}
if (result->value > (ptr - 1)) {
- _E("[DEBUG] Size of string should be larger than 1");
+ _E("[CONFIG] Size of string should be larger than 1");
return RESOURCED_ERROR_FAIL;
}
}
else {
- _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
+ _E("[CONFIG] Unknown configuration name (%s) and value (%s) on section (%s)",
result->name, result->value, result->section);
}
-
+
return error;
}
}
error = set_mem_action_conf(&memcg_conf->guiapp, result->value);
}
else {
- _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
+ _E("[CONFIG] Unknown configuration name (%s) and value (%s) on section (%s)",
result->name, result->value, result->section);
}
error = set_mem_action_conf(&memcg_conf->background, result->value);
}
else {
- _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
+ _E("[CONFIG] Unknown configuration name (%s) and value (%s) on section (%s)",
result->name, result->value, result->section);
}
return error;
}
else {
- _E("[DEBUG] Unknown section name (%s) and value (%s) on section (%s)",
+ _E("[CONFIG] Unknown section name (%s) and value (%s) on section (%s)",
result->name, result->value, result->section);
}
/* Module disabled on runtime or just failed to start. */
if (ret < 0) {
module->initalized = MODULE_DROPPED;
- _E("[DEBUG] Fail to initialize [%s] module, dropped.", module->name);
+ _E("Fail to initialize [%s] module, dropped.", module->name);
continue;
}
{
int error;
- _I("[DEBUG] policy = %s", attr->sched_policy == SCHED_IDLE ? "SCHED_IDLE" :
+ _I("[CPU-SCHED] policy = %s", attr->sched_policy == SCHED_IDLE ? "SCHED_IDLE" :
attr->sched_policy == SCHED_BATCH ? "SCHED_BATCH" :
attr->sched_policy == SCHED_OTHER ? "SCHED_OTHER" :
attr->sched_policy == SCHED_FIFO ? "SCHED_FIFO" :
switch (attr->sched_policy) {
case SCHED_IDLE:
if (attr->sched_priority != 0) {
- _E("[DEBUG] priority of SCHED_IDLE should be 0");
+ _E("[CPU-SCHED] priority of SCHED_IDLE should be 0");
return RESOURCED_ERROR_FAIL;
}
break;
case SCHED_BATCH:
case SCHED_OTHER:
if (attr->sched_priority != 0) {
- _E("[DEBUG] priority of %s should be 0", attr->sched_policy == SCHED_BATCH ? "SCHED_BATCH" : "SCHED_OTHER");
+ _E("[CPU-SCHED] priority of %s should be 0", attr->sched_policy == SCHED_BATCH ? "SCHED_BATCH" : "SCHED_OTHER");
return RESOURCED_ERROR_FAIL;
}
if (attr->sched_nice == CPU_INIT_NICE) {
- _W("[DEBUG] nice value should be located between %d and %d",
+ _W("[CPU-SCHED] nice value should be located between %d and %d",
CPU_MIN_NICE, CPU_MAX_NICE);
return RESOURCED_ERROR_FAIL;
}
case SCHED_FIFO:
case SCHED_RR:
if (attr->sched_priority == CPU_INIT_PRIO) {
- _E("[DEBUG] priority of %s should be located between %d and %d",
+ _E("[CPU-SCHED] priority of %s should be located between %d and %d",
attr->sched_policy == SCHED_FIFO ? "SCHED_FIFO" : "SCHED_RR",
CPU_MIN_PRIO, CPU_MAX_PRIO);
return RESOURCED_ERROR_FAIL;
}
break;
case SCHED_DEADLINE:
- _W("[DEBUG] we do not support deadline scheulder yet");
+ _W("[CPU-SCHED] we do not support deadline scheulder yet");
return RESOURCED_ERROR_NONE;
default:
- _E("[DEBUG] Unknown sched type (%d)", attr->sched_policy);
+ _E("[CPU-SCHED] Unknown sched type (%d)", attr->sched_policy);
return RESOURCED_ERROR_FAIL;
}
}
#endif
if (error) {
- _E("[DEBUG] Failed to set policy and priority");
+ _E("[CPU-SCHED] Failed to set policy and priority");
return RESOURCED_ERROR_FAIL;
}
runtime_app_info_path = proc_get_runtime_app_info_path(pai);
if (!runtime_app_info_path) {
- _E("Failed to get runtime appinfo path: not enough memory");
+ _E("[PROCESS] Failed to get runtime appinfo path: not enough memory");
return;
}
ret = proc_runtime_app_info_write_procs(runtime_app_info_path, pai->childs);
if (ret < 0)
- _E("Failed to write appinfo children '%s': %m", runtime_app_info_path);
+ _E("[PROCESS] Failed to write appinfo children '%s': %m", runtime_app_info_path);
}
void proc_set_process_memory_state(struct proc_app_info *pai,
int ret;
if (!pai) {
- _E("process app info is NULL");
+ _E("[PROCESS] process app info is NULL");
return RESOURCED_ERROR_NO_DATA;
}
} else {
pai->runtime_exclude = type;
}
- _D("pid %d set proc exclude list, type = %d, exclude = %d",
+ _D("[PROCESS] pid %d set proc exclude list, type = %d, exclude = %d",
pid, type, pai->runtime_exclude);
runtime_app_info_path = proc_get_runtime_app_info_path(pai);
ppi = find_program_info(pkgname);
if (!ppi) {
- _D("Can't find %s in the program list. Start to add it", pkgname);
+ _D("[PROCESS] Can't find %s in the program list. Start to add it", pkgname);
ppi = calloc(sizeof(struct proc_program_info), 1);
if (!ppi) {
- _E("Fail to add %s : not enough memory", pkgname);
+ _E("[PROCESS] Fail to add %s : not enough memory", pkgname);
return NULL;
}
ppi->pkgname = strndup(pkgname, strlen(pkgname)+1);
if (!ppi->pkgname) {
- _E("Fail to add %s : not enough memory", pkgname);
+ _E("[PROCESS] Fail to add %s : not enough memory", pkgname);
free(ppi);
return NULL;
}
proc_program_list = g_slist_prepend(proc_program_list, ppi);
- _I("%s is added in the program info", pkgname);
+ _I("[PROCESS] %s is added in the program info", pkgname);
}
if (is_ui_app(type))
ppi->app_list = g_slist_prepend(ppi->app_list, pai);
ret = proc_runtime_write_app_info(pai);
if (ret < 0)
- _E("Failed to add runtime app info: %m");
+ _E("[PROCESS] Failed to add runtime app info: %m");
proc_app_list = proc_app_list_open();
app_list.list = g_slist_prepend(proc_app_list, pai);
ret = proc_runtime_remove_app_info(pai);
if (ret < 0)
- _E("Failed to remove appinfo '%s': %m", pai->appid);
+ _E("[PROCESS] Failed to remove appinfo '%s': %m", pai->appid);
proc_app_list = proc_app_list_open();
app_list.list = g_slist_remove(proc_app_list, pai);
int ret;
if (!appid || !pkgid) {
- _E("Each app should have appid and pkgid");
+ _E("[PROCESS] Each app should have appid and pkgid");
return NULL;
}
prelaunch = NULL;
if (!streq(pai->appid, appid)) {
- _E("prelaunched app(%s) is not matched with new app info(%s)",
+ _E("[PROCESS] prelaunched app(%s) is not matched with new app info(%s)",
pai->appid, appid);
proc_remove_app_info(pai);
pai = calloc(sizeof(struct proc_app_info), 1);
if (!pai)
return NULL;
- _I("app_info(%s) will be added without prelaunch", appid);
+ _I("[PROCESS] app_info(%s) will be added without prelaunch", appid);
}
} else {
/* prelaunch */
if (prelaunch) {
- _E("prelaunched app was not gone to launch state, appid(%s)", prelaunch->appid);
+ _E("[PROCESS] prelaunched app was not gone to launch state, appid(%s)", prelaunch->appid);
proc_remove_app_info(prelaunch);
prelaunch = NULL;
}
if (!pai->ai) {
pai->ai = resourced_appinfo_get(pai->ai, appid, pkgid);
if (!pai->ai) {
- _E("Failed to get resourced_appinfo, appid(%s), pkgid(%s)", appid, pkgid);
+ _E("[PROCESS] Failed to get resourced_appinfo, appid(%s), pkgid(%s)", appid, pkgid);
free(pai);
return NULL;
}
if (!pai->starttime) {
ret = proc_get_uptime(&uptime);
if (ret)
- _E("Failed to get uptime");
+ _E("[PROCESS] Failed to get uptime");
else
pai->starttime = uptime;
}
sched_setattr(pid, &attr, 0);
error = sched_getattr(pid, &attr, 0);
if (error)
- _E("[DEBUG] Failed to get sched attributes");
+ _E("[PROCESS] Failed to get sched attributes");
if (attr.sched_policy != SCHED_OTHER)
- _E("[DEBUG] current policy (%d) is different from %d",
+ _E("[PROCESS] current policy (%d) is different from %d",
attr.sched_policy, SCHED_OTHER);
break;
case CPU_SCHED_IDLE:
sched_setattr(pid, &attr, 0);
error = sched_getattr(pid, &attr, 0);
if (error)
- _E("[DEBUG] Failed to get sched attributes");
+ _E("[PROCESS] Failed to get sched attributes");
if (attr.sched_policy != SCHED_IDLE)
- _E("[DEBUG] current policy (%d) is different from %d",
+ _E("[PROCESS] current policy (%d) is different from %d",
attr.sched_policy, SCHED_IDLE);
break;
case CPU_SCHED_BATCH:
sched_setattr(pid, &attr, 0);
error = sched_getattr(pid, &attr, 0);
if (error)
- _E("[DEBUG] Failed to get sched attributes");
+ _E("[PROCESS] Failed to get sched attributes");
if (attr.sched_policy != SCHED_BATCH)
- _E("[DEBUG] current policy (%d) is different from %d",
+ _E("[PROCESS] current policy (%d) is different from %d",
attr.sched_policy, SCHED_BATCH);
break;
case CPU_SCHED_FIFO:
sched_setattr(pid, &attr, 0);
error = sched_getattr(pid, &attr, 0);
if (error)
- _E("[DEBUG] Failed to get sched attributes");
+ _E("[PROCESS] Failed to get sched attributes");
if (attr.sched_policy != SCHED_FIFO)
- _E("[DEBUG] current policy (%d) is different from %d",
+ _E("[PROCESS] current policy (%d) is different from %d",
attr.sched_policy, SCHED_FIFO);
break;
case CPU_SCHED_RR:
sched_setattr(pid, &attr, 0);
error = sched_getattr(pid, &attr, 0);
if (error)
- _E("[DEBUG] Failed to get sched attributes");
+ _E("[PROCESS] Failed to get sched attributes");
if (attr.sched_policy != SCHED_RR)
- _E("[DEBUG] current policy (%d) is different from %d",
+ _E("[PROCESS] current policy (%d) is different from %d",
attr.sched_policy, SCHED_RR);
break;
case CPU_SCHED_DEADLINE:
sched_setattr(pid, &attr, 0);
error = sched_getattr(pid, &attr, 0);
if (error)
- _E("[DEBUG] Failed to get sched attributes");
+ _E("[PROCESS] Failed to get sched attributes");
break;
default:
- _E("[DEBUG] Unknown CPU sched type");
+ _E("[PROCESS] Unknown CPU sched type");
}
- _I("[DEBUG] policy = %s", attr.sched_policy == SCHED_IDLE ? "SCHED_IDLE" :
+ _I("[PROCESS] policy = %s", attr.sched_policy == SCHED_IDLE ? "SCHED_IDLE" :
attr.sched_policy == SCHED_BATCH ? "SCHED_BATCH" :
attr.sched_policy == SCHED_OTHER ? "SCHED_OTHER" :
attr.sched_policy == SCHED_FIFO ? "SCHED_FIFO" :
attr.sched_policy == SCHED_RR ? "SCHED_RR" :
attr.sched_policy == SCHED_DEADLINE ? "SCHED_DEADLINE" : "UNKNOWN");
- _I("[DEBUG] nice = %d", attr.sched_nice);
- _I("[DEBUG] priority = %d", attr.sched_priority);
+ _I("[PROCESS] nice = %d", attr.sched_nice);
+ _I("[PROCESS] priority = %d", attr.sched_priority);
if (pci->watchdog_action == PROC_ACTION_IGNORE)
pai->app_watchdog_exclude = true;
runtime_app_info_path = proc_get_runtime_app_info_path(pai);
if (!runtime_app_info_path) {
- _E("Failed to get runtime appinfo path: not enough memory");
+ _E("[PROCESS] Failed to get runtime appinfo path: not enough memory");
return;
}
ret = proc_runtime_app_info_write_procs(runtime_app_info_path, pai->childs);
if (ret < 0)
- _E("Failed to write appinfo children '%s': %m", runtime_app_info_path);
+ _E("[PROCESS] Failed to write appinfo children '%s': %m", runtime_app_info_path);
return;
ret = proc_runtime_app_info_remove_procs(runtime_app_info_path);
if (ret < 0)
- _E("Failed to remove appinfo children '%s': %m", runtime_app_info_path);
+ _E("[PROCESS] Failed to remove appinfo children '%s': %m", runtime_app_info_path);
return;
}
if (module->init)
ret = module->init(data);
if (ret != RESOURCED_ERROR_NONE)
- _E("Fail to initialize [%s] module\n", module->name);
+ _E("[PROCESS] Fail to initialize [%s] module\n", module->name);
}
}
gslist_for_each_item(iter, proc_module) {
module = (struct proc_module_ops *)iter->data;
- _D("Deinitialize [%s] module\n", module->name);
+ _D("[PROCESS] Deinitialize [%s] module\n", module->name);
if (module->exit)
ret = module->exit(data);
if (ret != RESOURCED_ERROR_NONE)
- _E("Fail to deinitialize [%s] module\n", module->name);
+ _E("[PROCESS] Fail to deinitialize [%s] module\n", module->name);
}
}
ret = proc_get_oom_score_adj(main_pid, &oom_score_adj);
if (ret < 0) {
- _I("pid %d is already terminated.", main_pid);
+ _I("[PROCESS] pid %d is already terminated.", main_pid);
return ret;
}
(void) proc_app_list_add_app_info(pai);
- _I("runtime appinfo restored: %s, %s", appid, pkgname);
+ _I("[PROCESS] runtime appinfo restored: %s, %s", appid, pkgname);
return 0;
}
ret = asprintf(&path, RUNTIME_APP_INFO_DIR "/%s", dir->d_name);
if (ret < 0) {
- _E("Failed to allocate memory");
+ _E("[PROCESS] Failed to allocate memory");
return;
}
ret = proc_restore_runtime_app_info(path);
if (ret < 0)
- _E("Failed to restore runtime appinfo '%s': %m", dir->d_name);
+ _E("[PROCESS] Failed to restore runtime appinfo '%s': %m", dir->d_name);
}
}
{
int ret = mkdir(RUNTIME_APP_INFO_DIR, S_IRWXU | S_IRGRP | S_IXGRP);
if (ret < 0 && errno != EEXIST) {
- _E("Failed to create directory %s: %m", RUNTIME_APP_INFO_DIR);
+ _E("[PROCESS] Failed to create directory %s: %m", RUNTIME_APP_INFO_DIR);
return RESOURCED_ERROR_FAIL;
}
find_app_info(pid);
if (pai) {
- _D("get apptype = %d", pai->flags);
+ _D("[PROCESS] get apptype = %d", pai->flags);
return pai->flags;
} else
- _D("there is no process info for pid = %d", pid);
+ _D("[PROCESS] there is no process info for pid = %d", pid);
return PROC_NONE;
}
*/
ret = proc_get_oom_score_adj(ownerpid, &owner_oom);
if (ret < 0 || owner_oom == OOMADJ_BACKGRD_PERCEPTIBLE) {
- _D("owner pid(%d) was already terminated", ownerpid);
+ _D("[PROCESS] owner pid(%d) was already terminated", ownerpid);
return;
}
if (pai->main_pid == childpid) {
ret = proc_get_oom_score_adj(childpid, &child_oom);
if (ret < 0) {
- _D("can't get oom score for pid (%d)", childpid);
+ _D("[PROCESS] can't get oom score for pid (%d)", childpid);
child_oom = 0;
}
child_type = pai->type;
owner->runtime_exclude += pai->runtime_exclude;
proc_remove_app_info(pai);
} else {
- _D("main pid(%d) was different from childpid(%d)",
+ _D("[PROCESS] main pid(%d) was different from childpid(%d)",
pai->main_pid, childpid);
proc_app_info_remove_child_pid(pai, childpid);
}
if (status != PROC_CGROUP_SET_TERMINATED &&
status != PROC_CGROUP_SET_NOTI_REQUEST) {
if (!pid) {
- _E("invalid pid : %d of %s", pid, app_name ? app_name : "noprocess");
+ _E("[PROCESS] invalid pid : %d of %s", pid, app_name ? app_name : "noprocess");
return RESOURCED_ERROR_FAIL;
}
ret = proc_get_oom_score_adj(pid, &oom_score_adj);
if (ret < 0) {
- _E("Empty pid or process not exists. %d", pid);
+ _E("[PROCESS] Empty pid or process not exists. %d", pid);
return RESOURCED_ERROR_FAIL;
}
}
switch (status) {
case PROC_CGROUP_SET_FOREGRD:
if (app_name)
- _SD("set foreground: app %s, pid %d", app_name, pid);
+ _SD("[PROCESS] set foreground: app %s, pid %d", app_name, pid);
else
- _SD("set foreground: pid %d", pid);
+ _SD("[PROCESS] set foreground: pid %d", pid);
ps.pai = find_app_info(pid);
if (ps.pai)
break;
case PROC_CGROUP_SET_LAUNCH_REQUEST:
if (!app_name) {
- _E("launch request: need app name! pid %d", pid);
+ _E("[PROCESS] launch request: need app name! pid %d", pid);
return RESOURCED_ERROR_NO_DATA;
}
if (pkg_name)
- _SD("launch request: app %s, pkg %s, pid %d", app_name, pkg_name, pid);
+ _SD("[PROCESS] launch request: app %s, pkg %s, pid %d", app_name, pkg_name, pid);
else
- _SD("launch request: app %s, pid %d", app_name, pid);
+ _SD("[PROCESS] launch request: app %s, pid %d", app_name, pid);
ps.pai = proc_add_app_info(app_name, pkg_name, pid, 0, 0, apptype, PROC_STATE_FOREGROUND);
if (!ps.pai)
break;
-// proc_priority_set_fixed(&ps);
-
if (apptype == PROC_TYPE_WIDGET &&
!CHECK_BIT(ps.pai->flags, PROC_CGROUP_HIGH_ATTRIBUTE))
proc_set_oom_score_adj(pid, OOMADJ_BACKGRD_LOCKED, ps.pai);
break;
case PROC_CGROUP_SET_SERVICE_REQUEST:
if (!app_name) {
- _E("service launch request: need app name! pid = %d", pid);
+ _E("[PROCESS] service launch request: need app name! pid = %d", pid);
return RESOURCED_ERROR_NO_DATA;
}
if (pkg_name)
- _SD("service launch request: app %s, pkg %s, pid %d", app_name, pkg_name, pid);
+ _SD("[PROCESS] service launch request: app %s, pkg %s, pid %d", app_name, pkg_name, pid);
else
- _SD("service launch request: app %s, pid %d", app_name, pid);
+ _SD("[PROCESS] service launch request: app %s, pid %d", app_name, pid);
ps.pai = proc_add_app_info(app_name, pkg_name, pid, 0, 0, apptype, PROC_STATE_FOREGROUND);
if (!ps.pai)
break;
-// proc_priority_set_fixed(&ps);
proc_set_default_svc_oomscore(ps.pai->program, ps.pai);
resourced_notify(RESOURCED_NOTIFIER_SERVICE_LAUNCH, &ps);
case PROC_CGROUP_SET_RESUME_REQUEST:
/* init oom_score_value */
if (!app_name) {
- _E("resume request: need app name! pid = %d", pid);
+ _E("[PROCESS] resume request: need app name! pid = %d", pid);
return RESOURCED_ERROR_NO_DATA;
}
- _SD("resume request: app %s, pid %d", app_name, pid);
+ _SD("[PROCESS] resume request: app %s, pid %d", app_name, pid);
ps.pai = find_app_info(pid);
if (!ps.pai)
break;
case PROC_CGROUP_SET_TERMINATE_REQUEST:
if (app_name)
- _SD("terminate request: app %s, pid %d", app_name, pid);
+ _SD("[PROCESS] terminate request: app %s, pid %d", app_name, pid);
else
- _SD("terminate request: pid %d", pid);
+ _SD("[PROCESS] terminate request: pid %d", pid);
ps.pai = find_app_info(pid);
ps.pid = pid;
break;
case PROC_CGROUP_SET_BACKGRD:
if (app_name)
- _SD("set background: app %s, pid %d", app_name, pid);
+ _SD("[PROCESS] set background: app %s, pid %d", app_name, pid);
else
- _SD("set background: pid %d", pid);
+ _SD("[PROCESS] set background: pid %d", pid);
if (apptype == PROC_TYPE_WIDGET || apptype == PROC_TYPE_WATCH) {
ps.pai = find_app_info(pid);
break;
ps.pai = find_app_info_by_appid(app_name);
if (!ps.pai) {
- _E("set noti request: no entry for %s in app list!", app_name);
+ _E("[PROCESS] set noti request: no entry for %s in app list!", app_name);
break;
}
ps.pid = ps.pai->main_pid;
pid_t pid;
char *pidbuf = NULL, *cgroup_name = NULL, *pkg_name = NULL;
if (argnum < 1) {
- _E("Unsupported number of arguments!");
+ _E("[PROCESS] Unsupported number of arguments!");
return RESOURCED_ERROR_INVALID_PARAMETER;
}
pidbuf = arg[0];
pid = (pid_t)atoi(pidbuf);
if (pid < 0) {
- _E("Invalid pid argument!");
+ _E("[PROCESS] Invalid pid argument!");
return RESOURCED_ERROR_INVALID_PARAMETER;
}
cgroup_name = arg[1];
if (argnum == 3)
pkg_name = arg[2];
- _SD("appid %s, pid %d, status %d\n", cgroup_name, pid, status);
+ _SD("[PROCESS] appid %s, pid %d, status %d\n", cgroup_name, pid, status);
return resourced_proc_status_change(status, pid, cgroup_name, pkg_name, PROC_TYPE_GUI);
}
ret = proc_get_oom_score_adj(pid, (int *)buf);
break;
default:
- _E("unsupported command %d, pid(%d)", type, pid);
+ _E("[PROCESS] unsupported command %d, pid(%d)", type, pid);
ret = RESOURCED_ERROR_FAIL;
break;
}
now = time(NULL);
if (localtime_r(&now, &cur_tm) == NULL)
- _E("Fail to get localtime");
+ _E("[PROCESS] Fail to get localtime");
name_len = snprintf(filename, MAX_NAME_LENGTH,
"/%s_%.4d%.2d%.2d%.2d%.2d%.2d.log",
cur_tm.tm_mday, cur_tm.tm_hour, cur_tm.tm_min, cur_tm.tm_sec);
if (strlen(dirpath) + name_len + 1 > MAX_PATH_LENGTH) {
- _E("Dump path is too long");
+ _E("[PROCESS] Dump path is too long");
return;
}
pai = find_app_info(pid);
if (pai) {
- _I("[DEBUG] name: %s, limit: %u", pai->appid, limit);
+ _I("[MEMORY-LIMIT] name: %s, limit: %u", pai->appid, limit);
if (pai->memory.memlimit_update_exclude)
return;
{
struct memory_limit_event *mle = (struct memory_limit_event *)data;
if (!mle) {
- _E("[DEBUG] Memory limit event structure is NULL");
+ _E("[MEMORY-LIMIT] Memory limit event structure is NULL");
return;
}
} else {
ret = proc_get_cmdline(pid, appname, sizeof appname);
if (ret < 0) {
- _E("[DEBUG] Failed to get cmdline basename of pid(%d)", pid);
+ _E("[MEMORY-LIMIT] Failed to get cmdline basename of pid(%d)", pid);
return ret;
}
appid = appname;
RESOURCED_INTERFACE_OOM, SIGNAL_OOM_MEMLIMIT_EVENT,
g_variant_new("(is)", pid, appid));
if (ret < 0)
- _E("[DEBUG] Fail to broadcast dbus signal with pid(%d), appname(%s)", pid, appname);
+ _E("[MEMORY-LIMIT] Fail to broadcast dbus signal with pid(%d), appname(%s)", pid, appname);
return ret;
}
struct memory_limit_event *mle = (struct memory_limit_event *)data;
if (!mle) {
- _E("[DEBUG] memory limit event structure is NULL");
+ _E("[MEMORY-LIMIT] memory limit event structure is NULL");
goto timer_out;
}
if (mle->pids_array == NULL) {
- _E("[DEBUG] pids array should not be NULL");
+ _E("[MEMORY-LIMIT] pids array should not be NULL");
goto mle_timer_init;
}
continue;
if (kill(pid, 0) == 0) {
- _I("[DEBUG] dir %s's pid (%d) is still avlie, so kill forcely", mle->path, pid);
+ _I("[MEMORY-LIMIT] dir %s's pid (%d) is still avlie, so kill forcely", mle->path, pid);
safe_kill(pid, SIGKILL);
}
}
mle = g_hash_table_lookup(memory_limit_hash, cg_dir);
if (!mle) {
- _E("invalid event\n");
+ _E("[MEMORY-LIMIT] invalid event\n");
return false;
}
result = read(fd, &dummy_efd, sizeof(dummy_efd));
if (result < 0) {
- _E("[DEBUG] wrong eventfd %s\n", cg_dir);
+ _E("[MEMORY-LIMIT] wrong eventfd %s\n", cg_dir);
goto remove_mle;
}
if (access(cg_dir, F_OK) == -1) {
- _D("[DEBUG] there is no (%s) cgroup any longer, removing it", cg_dir);
+ _D("[MEMORY-LIMIT] there is no (%s) cgroup any longer, removing it", cg_dir);
goto remove_mle;
}
if (result < 0) {
result = cgroup_read_node_uint32(cg_dir, MEMCG_USAGE, &usage);
if (result < 0) {
- _D("[DEBUG] there is no (%s) cgroup any longer, removed it", cg_dir);
+ _D("[MEMORY-LIMIT] there is no (%s) cgroup any longer, removed it", cg_dir);
goto remove_mle;
}
}
if (usage < mle->threshold) {
- _D("[DEBUG] (%s) cgroup escaped low memory status. usage(%d), threshold(%d)",
+ _D("[MEMORY-LIMIT] (%s) cgroup escaped low memory status. usage(%d), threshold(%d)",
cg_dir, usage, mle->threshold);
return true;
}
continue;
if (lowmem_limit_broadcast(pid)) {
- _E("[DEBUG] Failed to broadcast of process (%s)", cg_dir);
+ _E("[MEMORY-LIMIT] Failed to broadcast of process (%s)", cg_dir);
safe_kill(pid, SIGTERM);
}
}
break;
default:
- _E("[DEBUG] Unkown action of memory threshold");
+ _E("[MEMORY-LIMIT] Unkown action of memory threshold");
}
return true;
memory_limit_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
NULL, memory_limit_hash_destroy);
if (!memory_limit_hash) {
- _E("[DEBUG] Failed to create hash table");
+ _E("[MEMORY-LIMIT] Failed to create hash table");
return RESOURCED_ERROR_FAIL;
}
}
if (fd > 0) {
mle = calloc(1, sizeof(struct memory_limit_event));
if (!mle) {
- _E("[DEBUG] out of memory");
+ _E("[MEMORY-LIMIT] out of memory");
return RESOURCED_ERROR_OUT_OF_MEMORY;
}
mle->fd = fd;
mle->path = (char *)strdup(dir);
if (!mle->path) {
- _E("[DEBUG] out of memory");
+ _E("[MEMORY-LIMIT] out of memory");
free(mle);
return RESOURCED_ERROR_OUT_OF_MEMORY;
}
ret = asprintf(&path, "%s/%s", MEMCG_HIGH_PP_PATH, pai->appid);
if (ret < 0) {
- _E("not enough memory");
+ _E("[MEMORY-LIMIT] not enough memory");
return RESOURCED_ERROR_OUT_OF_MEMORY;
}
cgroup_write_pid_fullpath(path, pai->main_pid);
unsigned int totalram = lowmem_get_totalram();
if (limit < MIN_LIMIT_VALUE || limit > totalram) {
- _E("[DEBUG] It's meaningless to set memory limit with size (%d)", limit);
+ _E("[MEMORY-LIMIT] It's meaningless to set memory limit with size (%d)", limit);
return;
}
return;
if (!name) {
- _E("[DEBUG] service name is NULL");
+ _E("[MEMORY-LIMIT] service name is NULL");
return;
}
result = asprintf(&path, "%s/%s", MEMCG_HIGH_PP_PATH, name);
if (result < 0) {
- _E("[DEBUG] not enough memory");
+ _E("[MEMORY-LIMIT] not enough memory");
return;
}
result = cgroup_make_subdir(MEMCG_HIGH_PP_PATH, name, NULL);
if (result < 0) {
- _E("[DEBUG] Failed to create cgroup subdir '%s/%s'",
+ _E("[MEMORY-LIMIT] Failed to create cgroup subdir '%s/%s'",
MEMCG_HIGH_PP_PATH, name);
return;
}
result = lowmem_reassign_limit(path, limit, action);
if (result < 0) {
- _W("Failed to reassign limit for %s", path);
+ _W("[MEMORY-LIMIT] Failed to reassign limit for %s", path);
return;
}
result = cgroup_write_node_uint32(path, MEMCG_MOVE_CHARGE, 3U);
if (result < 0)
- _W("[DEBUG] Failed to set immigrate mode for %s (non-crucial, continuing)", path);
+ _W("[MEMORY-LIMIT] Failed to set immigrate mode for %s (non-crucial, continuing)", path);
cgroup_write_pid_fullpath(path, pid);
}
unsigned int totalram = lowmem_get_totalram();
if (limit < MIN_LIMIT_VALUE || limit > totalram) {
- _E("[DEBUG] It's meaningless to set memory limit with size (%d)", limit);
+ _E("[MEMORY-LIMIT] It's meaningless to set memory limit with size (%d)", limit);
return RESOURCED_ERROR_INVALID_PARAMETER;
}
if (!pai) {
- _E("process app information is NULL");
+ _E("[MEMORY-LIMIT] process app information is NULL");
return RESOURCED_ERROR_INVALID_PARAMETER;
}
result = asprintf(&path, "%s/%s", MEMCG_HIGH_PP_PATH, pai->appid);
if (result < 0) {
- _E("not enough memory");
+ _E("[MEMORY-LIMIT] not enough memory");
return RESOURCED_ERROR_OUT_OF_MEMORY;
}
result = cgroup_make_subdir(MEMCG_HIGH_PP_PATH, pai->appid, NULL);
if (result < 0) {
- _E("Failed to create cgroup subdir '%s/%s'",
+ _E("[MEMORY-LIMIT] Failed to create cgroup subdir '%s/%s'",
MEMCG_HIGH_PP_PATH, pai->appid);
return result;
}
result = lowmem_reassign_limit(path, limit, action);
if (result < 0) {
- _W("Failed to reassign limit for %s", path);
+ _W("[MEMORY-LIMIT] Failed to reassign limit for %s", path);
return result;
}
result = cgroup_write_node_uint32(path, MEMCG_MOVE_CHARGE, 3U);
if (result < 0)
- _W("Failed to set immigrate mode for %s (non-crucial, continuing)", path);
+ _W("[MEMORY-LIMIT] Failed to set immigrate mode for %s (non-crucial, continuing)", path);
cgroup_write_pid_fullpath(path, pai->main_pid);
if (pai->childs) {
(mem_widget_limit && ps->pai->type == PROC_TYPE_WIDGET))
return lowmem_limit_appwidget(data);
- _E("[DEBUG] Unable to set foreground app limit - app type not supported");
+ _E("[MEMORY-LIMIT] Unable to set foreground app limit - app type not supported");
return RESOURCED_ERROR_NONE;
}
if (mem_bgapp_limit && mem_bgapp_action != PROC_ACTION_IGNORE) {
if (!(mem_guiapp_limit && mem_guiapp_action != PROC_ACTION_IGNORE) ||
!(mem_widget_limit && mem_widget_action != PROC_ACTION_IGNORE)) {
- _W("[DEBUG] Background app limit requires that both GUIApp and Widget limits to be set to work properly. Ignoring.");
+ _W("[MEMORY-LIMIT] Background app limit requires that both GUIApp and Widget limits to be set to work properly. Ignoring.");
} else {
register_notifier(RESOURCED_NOTIFIER_APP_BACKGRD, lowmem_limit_bgapp);
register_notifier(RESOURCED_NOTIFIER_APP_FOREGRD, lowmem_limit_fgapp);
if (cur_oom_score_adj != OOMADJ_APP_MAX + 10) {
/* VIP processes should not be asked to move. */
if (cur_memcg_idx <= CGROUP_VIP) {
- _E("[DEBUG] current cgroup (%s) cannot be VIP or Root", convert_cgroup_type_to_str(cur_memcg_idx));
+ _E("[MEMORY-CGROUP] current cgroup (%s) cannot be VIP or Root", convert_cgroup_type_to_str(cur_memcg_idx));
return;
}
}
{
/* print info of Memory section */
for (int cgroup = CGROUP_VIP; cgroup < CGROUP_END; cgroup++) {
- _I("[DEBUG] set memory for cgroup '%s' to %u bytes",
+ _I("[MEMORY-CGROUP] set memory for cgroup '%s' to %u bytes",
convert_cgroup_type_to_str(cgroup), get_memcg_info(cgroup)->limit);
}
for (int mem_lvl = 0; mem_lvl < MEM_LEVEL_MAX; mem_lvl++)
- _I("[DEBUG] set threshold for memory level '%s' to %u MB",
+ _I("[MEMORY-LEVEL] set threshold for memory level '%s' to %u MB",
convert_memstate_to_str(mem_lvl), get_root_memcg_info()->threshold[mem_lvl]);
- _I("[DEBUG] set number of max victims as %d", num_max_victims);
- _I("[DEBUG] set threshold leave to %u MB", get_root_memcg_info()->threshold_leave);
- _I("[DEBUG] set proactive threshold to %u MB", proactive_threshold);
- _I("[DEBUG] set proactive low memory killer leave to %u MB", proactive_leave);
+ _I("[LMK] set number of max victims as %d", num_max_victims);
+ _I("[LMK] set threshold leave to %u MB", get_root_memcg_info()->threshold_leave);
+ _I("[LMK] set proactive threshold to %u MB", proactive_threshold);
+ _I("[LMK] set proactive low memory killer leave to %u MB", proactive_leave);
/* print info of POPUP section */
- _I("[DEBUG] oom popup is %s", oom_popup_enable == true ? "enabled" : "disabled");
+ _I("[POPUP] oom popup is %s", oom_popup_enable == true ? "enabled" : "disabled");
/* print info of BackgroundReclaim section */
- _I("[DEBUG] Background reclaim is %s", bg_reclaim == true ? "enabled" : "disabled");
+ _I("Background reclaim is %s", bg_reclaim == true ? "enabled" : "disabled");
}
#include "file-helper.h"
{
int ret = RESOURCED_ERROR_NONE;
- _D("[DEBUG] resourced memory init start");
+ _D("resourced memory init start");
/* init memcg */
ret = cgroup_make_full_subdir(MEMCG_PATH);
/* make a worker thread called low memory killer */
ret = lowmem_activate_worker();
if (ret) {
- _E("[DEBUG] oom thread create failed\n");
+ _E("[LMK] oom thread create failed\n");
return ret;
}
/* register threshold and event fd */
ret = lowmem_press_setup_eventfd();
if (ret) {
- _E("[DEBUG] eventfd setup failed");
+ _E("[MEMORY-LIMIT] eventfd setup failed");
return ret;
}
r = cgroup_make_subdir(CPUSET_CGROUP, set->name, NULL);
if (r < 0) {
- _E("[DEBUG] failed to make cpuset cgroup (%s)", set->name);
+ _E("[CPU-SCHED] failed to make cpuset cgroup (%s)", set->name);
return r;
}
r = snprintf(buf, sizeof buf, "%s/%s", CPUSET_CGROUP, set->name);
if (r < 0) {
- _E("[DEBUG] failed to setup memory nodes for cpuset (%s)", set->name);
+ _E("[CPU-SCHED] failed to setup memory nodes for cpuset (%s)", set->name);
return r;
}
/* don't force any memory nodes with this cpuset */
r = cgroup_write_node_uint32(buf, "cpuset.mems", 0);
ret_value_msg_if(r < 0, r,
- "[DEBUG] Failed to reset memory nodes for cpuset: %m");
+ "[CPU-SCHED] Failed to reset memory nodes for cpuset: %m");
return 0;
}
c->name = name;
if (cpu_sched_parse_cpuset(c, get_cpucg_conf_value()) < 0) {
- _E("[DEBUG] cpu-sched parse %s coreset: could not parse", name);
+ _E("[CPU-SCHED] cpu-sched parse %s coreset: could not parse", name);
return RESOURCED_ERROR_FAIL;
}
{
struct cpu_sched_conf *cpu_sched_conf = get_cpu_sched_conf();
if (cpu_sched_conf == NULL) {
- _E("[DEBUG] cpu sched configuration structure should not be NULL");
+ _E("[CPU-SCHED] cpu sched configuration structure should not be NULL");
return RESOURCED_ERROR_FAIL;
}
if (cpu_sched_conf->cpu_sched_flag) {
if (CHECK_BIT(cpu_sched_conf->cpu_sched_flag, CPU_SCHED_RUNTIME_SHARE) &&
CHECK_BIT(cpu_sched_conf->cpu_sched_flag, CPU_SCHED_NO_RUNTIME_SHARE)) {
- _E("[DEBUG] RT_RUNTIME_SHARE and NO_RT_RUNTIME_SHARE cannot be coexisted");
+ _E("[CPU-SCHED] RT_RUNTIME_SHARE and NO_RT_RUNTIME_SHARE cannot be coexisted");
}
else {
/* RT_RUNTIME_SHARE */
}
}
- _I("[DEBUG] rt_period_us = %d", cpu_sched_conf->rt_period_us);
- _I("[DEBUG] rt_runtime_us = %d", cpu_sched_conf->rt_runtime_us);
- _I("[DEBUG] cpu_sched_feature = %d", cpu_sched_conf->cpu_sched_flag);
+ _I("[CPU-SCHED] rt_period_us = %d", cpu_sched_conf->rt_period_us);
+ _I("[CPU-SCHED] rt_runtime_us = %d", cpu_sched_conf->rt_runtime_us);
+ _I("[CPU-SCHED] cpu_sched_feature = %d", cpu_sched_conf->cpu_sched_flag);
free_cpu_sched_conf();
return RESOURCED_ERROR_NONE;
result = cgroup_read_node_int32(CPUCG_PATH, CPUCG_RT_CONTROL_BANDWIDTH, &runtime);
if (result < 0) {
- _W("[DEBUG] rt_runtime_us is not supported");
+ _W("[CPU-SCHED] rt_runtime_us is not supported");
return RESOURCED_ERROR_FAIL;
}
result = asprintf(&path, "%s/%s", CPUCG_HIGH_PP_PATH, ps->pci->name);
if (result < 0) {
- _E("[DEBUG] not enough memory");
+ _E("[CPU-SCHED] not enough memory");
return RESOURCED_ERROR_OUT_OF_MEMORY;
}
result = cgroup_make_subdir(CPUCG_HIGH_PP_PATH, ps->pci->name, NULL);
if (result < 0) {
- _E("[DEBUG] Failed to create cgroup subdir '%s/%s'",
+ _E("[CPU-SCHED] Failed to create cgroup subdir '%s/%s'",
CPUCG_HIGH_PP_PATH, ps->pci->name);
return RESOURCED_ERROR_FAIL;
}
free_compact_conf();
- _I("[DEBUG] compact status: %d", compact->status);
- _I("[DEBUG] compact frag_level: %d", compact->frag_level);
+ _I("[COMPACTION] compact status: %d", compact->status);
+ _I("[COMPACTION] compact frag_level: %d", compact->frag_level);
return RESOURCED_ERROR_NONE;
}
struct compact_control *compact;
int result = RESOURCED_ERROR_OUT_OF_MEMORY;
- _I("[DEBUG] compact init");
+ _I("[COMPACTION] compact init");
pthread_mutex_lock(&compact_data.drained_lock);
if (compact_data.compact) {
- _E("[DEBUG] Unbalanced calls to compact module load/unload\n");
+ _E("[COMPACTION] Unbalanced calls to compact module load/unload\n");
result = RESOURCED_ERROR_NONE;
goto leave;
}
result = pthread_mutex_init(&compact->lock, NULL);
if (result) {
- _E("[DEBUG] Failed to init compact lock: %m");
+ _E("[COMPACTION] Failed to init compact lock: %m");
goto cleanup_all;
}
compact_parse_config_file(compact);
if (compact->status & COMPACT_SKIP) {
- _I("[DEBUG] Compaction module disabled.");
+ _I("[COMPACTION] Compaction module disabled.");
result = RESOURCED_ERROR_FAIL;
goto cleanup_all;
}
static int swap_file_conf(void *data)
{
- _I("[DEBUG] fileswap crypt type = %s", file_control.crypt_type);
- _I("[DEBUG] fileswap file size = %ld", file_control.swap_file_size);
+ _I("[SWAP] fileswap crypt type = %s", file_control.crypt_type);
+ _I("[SWAP] fileswap file size = %ld", file_control.swap_file_size);
return RESOURCED_ERROR_NONE;
}
static void print_swap_conf(void)
{
- _I("[DEBUG] swap %s", arg_swap_enable == true ? "enable" : "disable");
- _I("[DEBUG] swap at boot %s", arg_swap_at_boot == true ? "enable" : "disable");
- _I("[DEBUG] swap type = %d", arg_swap_type);
+ _I("[SWAP] swap %s", arg_swap_enable == true ? "enable" : "disable");
+ _I("[SWAP] swap at boot %s", arg_swap_at_boot == true ? "enable" : "disable");
+ _I("[SWAP] swap type = %d", arg_swap_type);
for(int cgroup = CGROUP_VIP; cgroup < CGROUP_END; cgroup++) {
- _I("[DEBUG] cgroup (%s) swapiness = %d", cgroup == CGROUP_VIP ? "vip" :
+ _I("[SWAP] cgroup (%s) swapiness = %d", cgroup == CGROUP_VIP ? "vip" :
cgroup == CGROUP_HIGH ? "high" :
cgroup == CGROUP_MEDIUM ? "medium" : "lowest", get_memcg_info(cgroup)->swappiness);
}
if (zram_conf->ratio > 0.0)
zram_control.ratio = zram_conf->ratio;
- _I("[DEBUG] zram algorithm = %s", zram_control.comp_algorithm);
- _I("[DEBUG] zram ratio = %f", zram_control.ratio);
+ _I("[SWAP] zram algorithm = %s", zram_control.comp_algorithm);
+ _I("[SWAP] zram ratio = %f", zram_control.ratio);
return RESOURCED_ERROR_NONE;
}
{
struct zswap_conf *zswap_conf = (struct zswap_conf *)data;
if (!zswap_conf) {
- _E("[DEBUG] Zswap configuration should not be NULL");
+ _E("[SWAP] Zswap configuration should not be NULL");
return RESOURCED_ERROR_FAIL;
}
else
memset(zswap_control.zpool_type, 0, MAX_TYPE_LENGTH);
- _I("[DEBUG] zswap type = %s", zswap_control.crypt_type);
- _I("[DEBUG] zswap filesize = %ld", zswap_control.zswap_file_size);
- _I("[DEBUG] zswap pool ratio = %f", zswap_control.zpool_ratio);
- _I("[DEBUG] zswap pool type = %s", zswap_control.zpool_type);
+ _I("[SWAP] zswap type = %s", zswap_control.crypt_type);
+ _I("[SWAP] zswap filesize = %ld", zswap_control.zswap_file_size);
+ _I("[SWAP] zswap pool ratio = %f", zswap_control.zpool_ratio);
+ _I("[SWAP] zswap pool type = %s", zswap_control.zpool_type);
return RESOURCED_ERROR_NONE;
pid_t pid = -1;
if (!pci) {
- _E("[DEBUG] process configuration information is NULL");
+ _E("process configuration information is NULL");
continue;
}
if (strncmp(pci->name, name, strlen(name) +1)) {
- _E("[DEBUG] key (%s) should be same with service name (%s)", name, pci->name);
+ _E("key (%s) should be same with service name (%s)", name, pci->name);
continue;
}
variant = systemd_get_service_property(pci->name, "ExecMainPID");
if (!g_variant_get_safe(variant, "u", &pid))
- _E("[DEBUG] Failed to get pid of a service (%s)", pci->name);
+ _E("Failed to get pid of a service (%s)", pci->name);
if (pid <= 0) {
- _W("[DEBUG] name (%s) pid should be larger than 0", pci->name);
+ _W("name (%s) pid should be larger than 0", pci->name);
continue;
}
sched_setattr(pid, &attr, 0);
error = sched_getattr(pid, &attr, 0);
if (error)
- _E("[DEBUG] Failed to get sched attributes");
+ _E("[CPU-SCHED] Failed to get sched attributes");
if (attr.sched_policy != SCHED_OTHER)
- _E("[DEBUG] current policy (%d) is different from %d",
+ _E("[CPU-SCHED] current policy (%d) is different from %d",
attr.sched_policy, SCHED_OTHER);
break;
case CPU_SCHED_IDLE:
sched_setattr(pid, &attr, 0);
error = sched_getattr(pid, &attr, 0);
if (error)
- _E("[DEBUG] Failed to get sched attributes");
+ _E("[CPU-SCHED] Failed to get sched attributes");
if (attr.sched_policy != SCHED_IDLE)
- _E("[DEBUG] current policy (%d) is different from %d",
+ _E("[CPU-SCHED] current policy (%d) is different from %d",
attr.sched_policy, SCHED_IDLE);
break;
case CPU_SCHED_BATCH:
sched_setattr(pid, &attr, 0);
error = sched_getattr(pid, &attr, 0);
if (error)
- _E("[DEBUG] Failed to get sched attributes");
+ _E("[CPU-SCHED] Failed to get sched attributes");
if (attr.sched_policy != SCHED_BATCH)
- _E("[DEBUG] current policy (%d) is different from %d",
+ _E("[CPU-SCHED] current policy (%d) is different from %d",
attr.sched_policy, SCHED_BATCH);
break;
case CPU_SCHED_FIFO:
sched_setattr(pid, &attr, 0);
error = sched_getattr(pid, &attr, 0);
if (error)
- _E("[DEBUG] Failed to get sched attributes");
+ _E("[CPU-SCHED] Failed to get sched attributes");
if (attr.sched_policy != SCHED_FIFO)
- _E("[DEBUG] current policy (%d) is different from %d",
+ _E("[CPU-SCHED] current policy (%d) is different from %d",
attr.sched_policy, SCHED_FIFO);
break;
case CPU_SCHED_RR:
sched_setattr(pid, &attr, 0);
error = sched_getattr(pid, &attr, 0);
if (error)
- _E("[DEBUG] Failed to get sched attributes");
+ _E("[CPU-SCHED] Failed to get sched attributes");
if (attr.sched_policy != SCHED_RR)
- _E("[DEBUG] current policy (%d) is different from %d",
+ _E("[CPU-SCHED] current policy (%d) is different from %d",
attr.sched_policy, SCHED_RR);
break;
case CPU_SCHED_DEADLINE:
sched_setattr(pid, &attr, 0);
error = sched_getattr(pid, &attr, 0);
if (error)
- _E("[DEBUG] Failed to get sched attributes");
+ _E("[CPU-SCHED] Failed to get sched attributes");
break;
default:
- _E("[DEBUG] Unknown CPU sched type");
+ _E("[CPU-SCHED] Unknown CPU sched type");
}
- _I("[DEBUG] %s's (pid = %d) policy = %s", pci->name, pid, attr.sched_policy == SCHED_IDLE ? "SCHED_IDLE" :
+ _I("[CPU-SCHED] %s's (pid = %d) policy = %s", pci->name, pid, attr.sched_policy == SCHED_IDLE ? "SCHED_IDLE" :
attr.sched_policy == SCHED_BATCH ? "SCHED_BATCH" :
attr.sched_policy == SCHED_OTHER ? "SCHED_OTHER" :
attr.sched_policy == SCHED_FIFO ? "SCHED_FIFO" :
attr.sched_policy == SCHED_RR ? "SCHED_RR" :
attr.sched_policy == SCHED_DEADLINE ? "SCHED_DEADLINE" : "UNKNOWN");
- _I("[DEBUG] %s's nice = %d", pci->name, attr.sched_nice);
- _I("[DEBUG] %s's priority = %d", pci->name, attr.sched_priority);
+ _I("[CPU-SCHED] %s's nice = %d", pci->name, attr.sched_nice);
+ _I("[CPU-SCHED] %s's priority = %d", pci->name, attr.sched_priority);
/* register a notification when this service is released */
switch (pci->fail_action) {
case PROC_ACTION_IGNORE:
break;
default:
- _W("[DEBUG] Currently we support only REBOOT when a service is released");
+ _W("[WATCHDOG] Currently we support only REBOOT when a service is released");
}
/* register RT throttling */