If DLOG and DB type, then <type> is 5 (0x01 | 0x04).
Example: logging=5
+4.3 ForegroundAppList
+=====================
+Key: App
+Value: <app name>
+Comment: Specify a target app name to fix foreground status oom score.
+ Predefined value cannot be used. Please reference 'OomScore' in section 7.1.
+ Keep in mind If both 'OomScore' in Section 7.1 and this configuration are set,
+ then resourced ignores 'OomScore' configuration.
+Example: App=org.tizen.setting
+ App=com.samsung.browser
+ App=ise-default
+
5. limiter.conf.d/*.conf
========================
pci->fail_action = PROC_ACTION_IGNORE;
pci->cpu_boosting_level = CPU_BOOSTING_LEVEL_NONE;
pci->oom_score = OOMADJ_APP_MAX + 10;
+ pci->is_app_in_foreground_app_list = false;
strncpy(pci->name, name, sizeof(pci->name)-1);
return RESOURCED_ERROR_NONE;
return RESOURCED_ERROR_NONE;
}
+static int process_config(struct parse_result *result, void *user_data)
+{
+ int ret;
+ struct proc_conf_info *pci;
+
+ if (!result)
+ return RESOURCED_ERROR_INVALID_PARAMETER;
+
+ if (strncmp(result->section, FOREGROUND_APP_LIST_SECTION,
+ strlen(FOREGROUND_APP_LIST_SECTION) + 1))
+ return RESOURCED_ERROR_NONE;
+
+ if (strncmp(result->name, APP_NAME_CONF,
+ strlen(APP_NAME_CONF) + 1)) {
+ _W("[CONFIG] Unknown configuration name (%s) and value (%s) on section (%s)",
+ result->name, result->value, result->section);
+ return RESOURCED_ERROR_NONE;
+ }
+
+ pci = fixed_app_and_service_exist_check(result->value, APP_TYPE);
+ if (pci == NULL) {
+ pci = (struct proc_conf_info *)calloc(1, sizeof(struct proc_conf_info));
+ if (pci == NULL) {
+ _E("Failed to allocate memory during parsing configurations");
+ return RESOURCED_ERROR_OUT_OF_MEMORY;
+ }
+
+ ret = register_proc_conf_info(pci, result->value, APP_TYPE);
+ if (ret < 0)
+ return ret;
+ }
+
+ pci->is_app_in_foreground_app_list = true;
+
+ return RESOURCED_ERROR_NONE;
+}
+
static int optimizer_config(struct parse_result *result, void *user_data)
{
if (!result)
config_type = OPTIMIZER_CONFIG;
load_per_vendor_configs(OPTIMIZER_CONF_DIR, vendor_config, &config_type);
- /* Load configuration in process.conf */
+ /* Load configuration in process.conf.d or process.conf */
+ if (access(PACKAGE_CUSTOM_CONF_FILE(process), F_OK) == 0)
+ config_parse(PACKAGE_CUSTOM_CONF_FILE(process), process_config, NULL);
+ else
+ config_parse(PROCESS_CONF_FILE, process_config, NULL);
+
config_type = PROCESS_CONFIG;
load_per_vendor_configs(PROC_CONF_DIR, vendor_config, &config_type);
#define LIMITER_CONF_FILE RD_CONFIG_FILE(limiter)
#define OPTIMIZER_CONF_FILE RD_CONFIG_FILE(optimizer)
+#define PROCESS_CONF_FILE RD_CONFIG_FILE(process)
#define LIMITER_CONF_DIR RD_CONFIG_PATH"/limiter.conf.d"
#define OPTIMIZER_CONF_DIR RD_CONFIG_PATH"/optimizer.conf.d"
#define PROC_CONF_DIR RD_CONFIG_PATH"/process.conf.d"
/* old style */
#define VIP_CONF_DIR RD_CONFIG_PATH"/vip-process.d"
+#define PACKAGE_CUSTOM_CONF_FILE(name) \
+ RD_CONFIG_PATH"/"#name".conf.d/"#name".conf"
+
/* section name */
/* limiter.conf */
#define PRIVATE_SECTION "Private"
#define CPU_BOOSTING_LEVEL_MEDIUM_SECTION "CpuBoostingLevelMedium"
#define CPU_BOOSTING_LEVEL_WEAK_SECTION "CpuBoostingLevelWeak"
+/* process.conf */
+#define FOREGROUND_APP_LIST_SECTION "ForegroundAppList"
+
/* configuration name */
/* limiter.conf */
#define APP_NAME_CONF "App"
#define OLD_ACTION_ON_FAILURE_NAME_CONF "ACTION_ON_FAILURE"
#define WATCHDOG_ACTION_NAME_CONF "WatchdogAction"
#define OOM_SCORE_NAME_CONF "OomScore"
+#define FOREGROUND_OOM_SCORE_NAME_CONF "ForegroundOomScore"
#define THROTTLING_LIMIT_NAME_CONF "ThrottlingLimit"
#define MEDIUM_LEVEL_NAME_CONF "MediumLevel"
#define LOW_LEVEL_NAME_CONF "LowLevel"