cpu-sched: add new module 62/236962/6
authorMaciej Słodczyk <m.slodczyk2@partner.samsung.com>
Tue, 23 Jun 2020 13:57:59 +0000 (15:57 +0200)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Tue, 21 Jul 2020 11:55:59 +0000 (11:55 +0000)
Change-Id: I324d4e32be5d64ba993f8637d0500d8f76c3986b
Signed-off-by: Maciej Słodczyk <m.slodczyk2@partner.samsung.com>
packaging/resourced.spec
src/CMakeLists.txt
src/cpu/cpu-sched.c [new file with mode: 0644]
src/cpu/cpu-sched.conf [new file with mode: 0644]

index 3f0bbb4..64c67dd 100644 (file)
@@ -159,7 +159,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 heart memory proc swap vip-process
+%define config_files block cpu cpu-sched heart memory proc swap vip-process
 
 for i in %{confdir}/*.conf; do
        if [ "$i" = %{confdir}/"*.conf" ]; then
@@ -225,6 +225,7 @@ fi
 %{confdir}/configs/config-block.conf
 %{confdir}/configs/config-heart.conf
 %{confdir}/configs/config-cpu.conf
+%{confdir}/configs/config-cpu-sched.conf
 
 %if %{?mem_stress} == ON
 %files mem-stress
index d77b743..46e0380 100644 (file)
@@ -212,6 +212,8 @@ ENDIF()
 IF("${CPU_MODULE}" STREQUAL "ON")
   INSTALL(FILES ${CPU_SOURCE_DIR}/cpu.conf
          DESTINATION ${RD_CONFIG_PATH} RENAME cpu.conf)
+  INSTALL(FILES ${CPU_SOURCE_DIR}/cpu-sched.conf
+         DESTINATION ${RD_CONFIG_PATH} RENAME cpu-sched.conf)
 ENDIF()
 
 IF("${VIP_AGENT}" STREQUAL "ON")
diff --git a/src/cpu/cpu-sched.c b/src/cpu/cpu-sched.c
new file mode 100644 (file)
index 0000000..0c81506
--- /dev/null
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include "module.h"
+#include "macro.h"
+#include "resourced.h"
+
+static int cpu_sched_init(void *data)
+{
+       _D("cpu-sched: init module");
+       return RESOURCED_ERROR_NONE;
+}
+
+static int cpu_sched_finalize(void *data)
+{
+       _D("cpu-sched: deinit module");
+       return RESOURCED_ERROR_NONE;
+}
+
+static struct module_ops cpu_sched_modules_ops = {
+       .priority = MODULE_PRIORITY_NORMAL,
+       .name = "cpu-sched",
+       .init = cpu_sched_init,
+       .exit = cpu_sched_finalize,
+};
+
+MODULE_REGISTER(&cpu_sched_modules_ops)
diff --git a/src/cpu/cpu-sched.conf b/src/cpu/cpu-sched.conf
new file mode 100644 (file)
index 0000000..e69de29