Modify configuration file name/path 31/269331/3
authorUnsung Lee <unsung.lee@samsung.com>
Wed, 12 Jan 2022 11:18:57 +0000 (20:18 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Thu, 13 Jan 2022 02:41:56 +0000 (11:41 +0900)
Change-Id: I3b84a0961d379e127025762ee6b2a705ad14d031
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
18 files changed:
CMakeLists.txt
conf/block.conf [moved from src/process/block/block.conf with 100% similarity]
conf/cpu-sched.conf [moved from src/resource-limiter/cpu/cpu-sched.conf with 100% similarity]
conf/cpu.conf [moved from src/resource-limiter/cpu/cpu.conf with 100% similarity]
conf/dedup.conf [moved from src/resource-optimizer/memory/dedup/dedup.conf with 100% similarity]
conf/heart.conf [moved from src/resource-monitor/heart.conf with 100% similarity]
conf/memory-profile-iot-headless.conf [moved from src/resource-limiter/memory/memory.conf with 100% similarity]
conf/memory-profile-tv.conf [moved from src/resource-limiter/memory/memory-tv.conf with 100% similarity]
conf/memory.conf [moved from src/resource-limiter/memory/memory-iot-headless.conf with 100% similarity]
conf/org.tizen.resourced.conf [moved from resourced.conf with 100% similarity]
conf/process.conf [moved from src/process/proc.conf with 100% similarity]
conf/swap.conf [moved from src/resource-optimizer/memory/swap/swap.conf with 100% similarity]
packaging/resourced.spec
src/CMakeLists.txt
src/process/priority/proc-priority.c
src/process/proc-appusage.c
src/process/proc-main.c
src/resource-limiter/cpu/cpu.c

index 1b2cc84..0c30bd5 100644 (file)
@@ -42,6 +42,7 @@ SET(CMAKELISTS_DIR                                  ${CMAKE_SOURCE_DIR}/CMakeLis
 SET(INCLUDE_COMMON_DIR                              ${CMAKE_SOURCE_DIR}/src/common)
 SET(INCLUDE_CGROUP_DIR                              ${CMAKE_SOURCE_DIR}/src/common/cgroup)
 SET(INCLUDE_PUBLIC_DIR                              ${CMAKE_SOURCE_DIR}/include)
+SET(CONF_DIR                                                                           ${CMAKE_SOURCE_DIR}/conf)
 SET(RESOURCED_INCLUDEDIR                            ${INCLUDE_COMMON_DIR} ${INCLUDE_CGROUP_DIR} ${INCLUDE_PUBLIC_DIR})
 
 #misc
@@ -81,7 +82,7 @@ SET(WATCHDOG_SOURCE_DIR                             ${PROCESS_SOURCE_DIR}/watchd
 SET(PRIORITY_SOURCE_DIR                             ${PROCESS_SOURCE_DIR}/priority)
 
 
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/resourced.conf DESTINATION /etc/dbus-1/system.d)
+INSTALL(FILES ${CONF_DIR}/org.tizen.resourced.conf DESTINATION /etc/dbus-1/system.d)
 
 ADD_SUBDIRECTORY(src)
 IF(DEFINED RD_TESTS_PATH)
similarity index 100%
rename from src/process/block/block.conf
rename to conf/block.conf
similarity index 100%
rename from resourced.conf
rename to conf/org.tizen.resourced.conf
similarity index 100%
rename from src/process/proc.conf
rename to conf/process.conf
index 893cff9..c590009 100644 (file)
@@ -157,7 +157,7 @@ mkdir -p %{buildroot}/%{confdir}/configs
 #   https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#ordering
 
 # List of configuration files provided by this package - update when any new config file is added!
-%define config_files block cpu cpu-sched heart memory proc swap dedup
+%define config_files block cpu cpu-sched heart memory process swap dedup
 
 for i in %{confdir}/*.conf; do
        if [ "$i" = %{confdir}/"*.conf" ]; then
@@ -188,19 +188,19 @@ if [ $1 -eq 0 ]; then
 fi
 
 %post config-tv
-%{_sbindir}/update-alternatives --install %{confdir}/memory.conf resourced-config-memory %{confdir}/configs/config-memory-tv.conf 150
+%{_sbindir}/update-alternatives --install %{confdir}/memory.conf resourced-config-memory %{confdir}/configs/config-memory-profile-tv.conf 150
 
 %preun config-tv
 if [ $1 -eq 0 ]; then
-       %{_sbindir}/update-alternatives --remove resourced-config-memory %{confdir}/configs/config-memory-tv.conf
+       %{_sbindir}/update-alternatives --remove resourced-config-memory %{confdir}/configs/config-memory-profile-tv.conf
 fi
 
 %post config-iot-headless
-%{_sbindir}/update-alternatives --install %{confdir}/memory.conf resourced-config-memory %{confdir}/configs/config-memory-iot-headless.conf 150
+%{_sbindir}/update-alternatives --install %{confdir}/memory.conf resourced-config-memory %{confdir}/configs/config-memory-profile-iot-headless.conf 150
 
 %preun config-iot-headless
 if [ $1 -eq 0 ]; then
-       %{_sbindir}/update-alternatives --remove resourced-config-memory %{confdir}/configs/config-memory-iot-headless.conf
+       %{_sbindir}/update-alternatives --remove resourced-config-memory %{confdir}/configs/config-memory-profile-iot-headless.conf
 fi
 
 %files
@@ -222,11 +222,11 @@ fi
 %attr(700, root, root) %{TZ_SYS_ETC}/dump.d/module.d/dump_heart_data.sh
 
 %files config
-%config %{_sysconfdir}/dbus-1/system.d/resourced.conf
+%config %{_sysconfdir}/dbus-1/system.d/org.tizen.resourced.conf
 %{_unitdir}/resourced.service
 %{_unitdir}/multi-user.target.wants/resourced.service
 %{confdir}/configs/config-memory.conf
-%{confdir}/configs/config-proc.conf
+%{confdir}/configs/config-process.conf
 %{confdir}/configs/config-swap.conf
 %{confdir}/configs/config-dedup.conf
 %{confdir}/configs/config-block.conf
@@ -236,11 +236,11 @@ fi
 
 %files config-tv
 %manifest resourced.manifest
-%{confdir}/configs/config-memory-tv.conf
+%{confdir}/configs/config-memory-profile-tv.conf
 
 %files config-iot-headless
 %manifest resourced.manifest
-%{confdir}/configs/config-memory-iot-headless.conf
+%{confdir}/configs/config-memory-profile-iot-headless.conf
 
 %if %{?vip_agent_module} == ON
 %files vip-release-agent
index 4fe2721..2ab2da7 100644 (file)
@@ -133,7 +133,7 @@ ADD_LIBRARY(block MODULE
        ${BLOCK_SOURCE_DIR}/block-monitor.c)
 TARGET_LINK_LIBRARIES(block resourced-private-api ${RESOURCED_REQUIRE_PKGS_LDFLAGS})
 INSTALL(TARGETS block DESTINATION ${MAKE_INSTALL_PREFIX}${RD_PLUGIN_PATH})
-INSTALL(FILES ${BLOCK_SOURCE_DIR}/block.conf DESTINATION ${RD_CONFIG_PATH})
+INSTALL(FILES ${CONF_DIR}/block.conf DESTINATION ${RD_CONFIG_PATH})
 
 ADD_DEFINITIONS("-DFREEZER_DIR=\"${LIB_INSTALL_DIR}\"")
 ADD_LIBRARY(freezer MODULE ${FREEZER_SOURCE_DIR}/freezer.c)
@@ -147,13 +147,13 @@ ADD_LIBRARY(swap MODULE
        ${SWAP_SOURCE_DIR}/zramswap.c)
 TARGET_LINK_LIBRARIES(swap resourced-private-api ${RESOURCED_REQUIRE_PKGS_LDFLAGS})
 INSTALL(TARGETS swap DESTINATION ${MAKE_INSTALL_PREFIX}${RD_PLUGIN_PATH})
-INSTALL(FILES ${SWAP_SOURCE_DIR}/swap.conf DESTINATION ${RD_CONFIG_PATH})
+INSTALL(FILES ${CONF_DIR}/swap.conf DESTINATION ${RD_CONFIG_PATH})
 
 ADD_LIBRARY(dedup MODULE
        ${DEDUP_SOURCE_DIR}/dedup.c)
 TARGET_LINK_LIBRARIES(dedup resourced-private-api ${RESOURCED_REQUIRE_PKGS_LDFLAGS})
 INSTALL(TARGETS dedup DESTINATION ${MAKE_INSTALL_PREFIX}${RD_PLUGIN_PATH})
-INSTALL(FILES ${DEDUP_SOURCE_DIR}/dedup.conf DESTINATION ${RD_CONFIG_PATH})
+INSTALL(FILES ${CONF_DIR}/dedup.conf DESTINATION ${RD_CONFIG_PATH})
 
 ADD_LIBRARY(heart MODULE
        ${RESOURCE_MONITOR_SOURCE_DIR}/heart.c
@@ -166,7 +166,7 @@ ADD_LIBRARY(heart MODULE
        ${RESOURCE_MONITOR_SOURCE_DIR}/logging.c)
 TARGET_LINK_LIBRARIES(heart resourced-private-api ${RESOURCED_REQUIRE_PKGS_LDFLAGS})
 INSTALL(TARGETS heart DESTINATION ${MAKE_INSTALL_PREFIX}${RD_PLUGIN_PATH})
-INSTALL(FILES ${RESOURCE_MONITOR_SOURCE_DIR}/heart.conf DESTINATION ${RD_CONFIG_PATH})
+INSTALL(FILES ${CONF_DIR}/heart.conf DESTINATION ${RD_CONFIG_PATH})
 CONFIGURE_FILE(${RESOURCE_MONITOR_SOURCE_DIR}/dump_heart_data.sh.in ${RESOURCE_MONITOR_SOURCE_DIR}/dump_heart_data.sh @ONLY)
 INSTALL(FILES ${RESOURCE_MONITOR_SOURCE_DIR}/dump_heart_data.sh DESTINATION ${RD_SYS_ETC}/dump.d/module.d)
 
@@ -219,15 +219,15 @@ INSTALL(TARGETS ${RD_BINARY_NAME}
   PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE WORLD_EXECUTE)
 
 IF("${MEMORY_MODULE}" STREQUAL "ON")
-       INSTALL(FILES ${MEMORY_LIMITER_SOURCE_DIR}/memory.conf DESTINATION ${RD_CONFIG_PATH})
-       INSTALL(FILES ${MEMORY_LIMITER_SOURCE_DIR}/memory-tv.conf DESTINATION ${RD_CONFIG_PATH})
-       INSTALL(FILES ${MEMORY_LIMITER_SOURCE_DIR}/memory-iot-headless.conf DESTINATION ${RD_CONFIG_PATH})
+       INSTALL(FILES ${CONF_DIR}/memory.conf DESTINATION ${RD_CONFIG_PATH})
+       INSTALL(FILES ${CONF_DIR}/memory-profile-tv.conf DESTINATION ${RD_CONFIG_PATH})
+       INSTALL(FILES ${CONF_DIR}/memory-profile-iot-headless.conf DESTINATION ${RD_CONFIG_PATH})
 ENDIF()
 
 IF("${CPU_MODULE}" STREQUAL "ON")
-  INSTALL(FILES ${CPU_LIMITER_SOURCE_DIR}/cpu.conf
+  INSTALL(FILES ${CONF_DIR}/cpu.conf
          DESTINATION ${RD_CONFIG_PATH} RENAME cpu.conf)
-  INSTALL(FILES ${CPU_LIMITER_SOURCE_DIR}/cpu-sched.conf
+  INSTALL(FILES ${CONF_DIR}/cpu-sched.conf
          DESTINATION ${RD_CONFIG_PATH} RENAME cpu-sched.conf)
 ENDIF()
 
@@ -239,5 +239,5 @@ IF("${VIP_AGENT}" STREQUAL "ON")
   INSTALL(TARGETS vip-release-agent DESTINATION bin)
 ENDIF()
 
-INSTALL(FILES ${PROCESS_SOURCE_DIR}/proc.conf
-       DESTINATION ${RD_CONFIG_PATH} RENAME proc.conf)
+INSTALL(FILES ${CONF_DIR}/process.conf
+       DESTINATION ${RD_CONFIG_PATH} RENAME process.conf)
index 728bf92..1211837 100644 (file)
@@ -36,7 +36,7 @@
 #include "resourced.h"
 #include "trace.h"
 
-#define PRIORITY_CONF_FILE     RD_CONFIG_FILE(proc)
+#define PRIORITY_CONF_FILE     RD_CONFIG_FILE(process)
 
 #define FIXED_OOM_CONF_SECTION "OOM_FIXED_APPS"
 
index 50da8ef..25f1b5d 100644 (file)
@@ -37,7 +37,7 @@
 #include "heart-common.h"
 
 #define UPDATE_INTERVAL        DAY_TO_SEC(2)
-#define APPUSAGE_CONF_FILE      RD_CONFIG_FILE(proc)
+#define APPUSAGE_CONF_FILE      RD_CONFIG_FILE(process)
 #define APPUSAGE_CONF_SECTION  "APPUSAGE"
 
 static int favorite_count;
index 6121d52..832224e 100644 (file)
@@ -60,7 +60,7 @@
 #endif
 #endif
 
-#define WATCHDOG_EXCLUDE_CONF_FILE             RD_CONFIG_FILE(proc)
+#define WATCHDOG_EXCLUDE_CONF_FILE             RD_CONFIG_FILE(process)
 #define WATCHDOG_EXCLUDE_CONF_SECTION  "WATCHDOG_EXCLUDED_PROCESSES"
 
 static GHashTable *watchdog_exclude_list;
index 9ae15fb..c39a8bf 100644 (file)
@@ -84,7 +84,7 @@ enum {
 
 enum cpu_control_type {
        SET_NONE,
-       SET_DEFAUT,
+       SET_DEFAULT,
        SET_BOOTING,
        SET_WRT,
        SET_LAZY,
@@ -182,7 +182,7 @@ static int load_cpu_config(struct parse_result *result, void *user_data)
                if (pid > 0) {
                        cpu_move_cgroup(pid, CPUCG_MEDIUM_GROUP_PATH);
                        def_list.control[def_list.num].pid = pid;
-                       def_list.control[def_list.num++].type = SET_DEFAUT;
+                       def_list.control[def_list.num++].type = SET_DEFAULT;
                } else {
                        _E("not found appname = %s", result->value);
                }
@@ -268,7 +268,7 @@ static int cpu_foreground_state(void *data)
        pri = getpriority(PRIO_PROCESS, ps->pid);
        if (pri == -1 || pri > CPU_DEFAULT_PRI)
                setpriority(PRIO_PGRP, ps->pid, CPU_DEFAULT_PRI);
-       if (check_predefined(ps->pid) != SET_DEFAUT)
+       if (check_predefined(ps->pid) != SET_DEFAULT)
                cpu_move_cgroup_foreach(ps->pid, ps->pai, CPUCG_HIGH_GROUP_PATH);
        return RESOURCED_ERROR_NONE;
 }
@@ -358,7 +358,7 @@ static int cpu_terminatestart_state(void *data)
 static int cpu_exclude_state(void *data)
 {
        struct proc_exclude *pe = (struct proc_exclude *)data;
-       if (check_predefined(pe->pid) == SET_DEFAUT)
+       if (check_predefined(pe->pid) == SET_DEFAULT)
                return RESOURCED_ERROR_NONE;
        if (pe->type == PROC_INCLUDE)
                cpu_move_cgroup(pe->pid, CPUCG_MEDIUM_GROUP_PATH);