pass-hal: tw3: Convert script format to json to improve readability 58/261958/3 accepted/tizen/unified/20210809.061355 submit/tizen/20210809.032652
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 29 Jul 2021 13:11:40 +0000 (22:11 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 2 Aug 2021 07:46:02 +0000 (16:46 +0900)
The legacy .conf file format is not better on side of readability.
So that change the configuration file format to json style to improve
readability.

And remove unneeded pass-resource2.conf.

Change-Id: Icf38292a3de92bb6c1a175ab327f0b7f8ec9ec15
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
CMakeLists.txt
packaging/pass-hal-tw3.spec
scripts/pass-resource0.conf [deleted file]
scripts/pass-resource0.json [new file with mode: 0644]
scripts/pass-resource1.conf [deleted file]
scripts/pass-resource1.json [new file with mode: 0644]
scripts/pass-resource2.conf [deleted file]
scripts/pass.conf [deleted file]
scripts/pass.json [new file with mode: 0644]

index 6cd265f44c18e54a8be9fa35ca019292000ecefb..6784891d861b88f5fd3166d62a70a6d25ed45a9c 100644 (file)
@@ -28,10 +28,9 @@ ADD_LIBRARY(${LIBRARY_NAME} SHARED ${SRCS})
 TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${pkgs_LDFLAGS} -ldl)
 
 SET(CONF_FILES
-       ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass.conf
-       ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource0.conf
-       ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource1.conf
-       ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource2.conf)
+       ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass.json
+       ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource0.json
+       ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource1.json)
 INSTALL(FILES ${CONF_FILES} DESTINATION /hal/etc/pass)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-hal.conf DESTINATION /hal/lib/tmpfiles.d)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION ${HAL_LICENSEDIR}/${PROJECT_NAME})
index 831d365347eccd0de4273c260d1ad745fc349490..28cf7fed40f4e2cc798d9621a9e8e285ad6bb1e8 100644 (file)
@@ -56,7 +56,6 @@ fi
 %{_hal_licensedir}/%{name}/LICENSE
 %{_hal_libdir}/*.so
 /hal/lib/tmpfiles.d/pass-hal.conf
-%config %{_hal_sysconfdir}/pass/pass.conf
-%config %{_hal_sysconfdir}/pass/pass-resource0.conf
-%config %{_hal_sysconfdir}/pass/pass-resource1.conf
-%config %{_hal_sysconfdir}/pass/pass-resource2.conf
+%config %{_hal_sysconfdir}/pass/pass.json
+%config %{_hal_sysconfdir}/pass/pass-resource0.json
+%config %{_hal_sysconfdir}/pass/pass-resource1.json
diff --git a/scripts/pass-resource0.conf b/scripts/pass-resource0.conf
deleted file mode 100644 (file)
index dcf9d00..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-[Pass]
-pass_support=1
-pass_gov_type=1
-
-pass_num_scenario_levels=4
-pass_init_scenario_level=0
-
-####################################################
-### Scenario Level for PMQoS and Thermal Monitor ###
-####################################################
-[ScenarioLevel0]
-limit_min_freq=449000
-limit_max_freq=1144000
-limit_min_cpu=0
-limit_max_cpu=2
-
-[ScenarioLevel1]
-limit_min_freq=1144000
-limit_max_freq=1144000
-limit_min_cpu=2
-limit_max_cpu=2
-
-[ScenarioLevel2]
-limit_min_freq=449000
-limit_max_freq=449000
-limit_min_cpu=0
-limit_max_cpu=1
-
-[ScenarioLevel3]
-limit_min_freq=449000
-limit_max_freq=1014000
-
-#########################
-### Scenario of PMQoS ###
-#########################
-[PassScenario]
-pass_scenario_support=yes
-pass_num_scenarios=3
-
-[Scenario0]
-name=AppLaunch
-support=yes
-scenario_level=1
-
-[Scenario1]
-name=UltraPowerSaving
-support=yes
-scenario_level=2
-
-[Scenario2]
-name=Doze
-support=yes
-scenario_level=3
-
-###################################
-### Scenario of Thermal Monitor ###
-###################################
-
-# Following action name are defiend on Tizen platform.
-# The 'temperature' of thermal.scenario must be defined in descending order.
-# If you change the following name, doesn't guarantee the compatibility.
-# - Release, Warning, LimitAction, Shutdown
-
-[thermal]
-thermal_support=yes
-thermal_number_of_scenario=4
-thermal_timer_interval_ms=10000
-
-[thermal.scenario0]
-support=yes
-name=Release
-temperature=44
-timer_interval_ms=10000
-scenario_level=0
-
-[thermal.scenario1]
-support=yes
-name=Warning
-temperature=46
-timer_interval_ms=5000
-
-[thermal.scenario2]
-support=yes
-name=LimitAction
-temperature=48
-timer_interval_ms=3000
-
-[thermal.scenario3]
-support=yes
-name=Shutdown
-temperature=53
-timer_interval_ms=1000
diff --git a/scripts/pass-resource0.json b/scripts/pass-resource0.json
new file mode 100644 (file)
index 0000000..b95697c
--- /dev/null
@@ -0,0 +1,71 @@
+{
+       "support"                       : true,
+       "init_level"                    : 0,
+       "level_list"                    :
+       [
+               {
+                       "level"                         : 0,
+                       "dvfs,minimum_frequency_khz"    : 449000,
+                       "dvfs,maximum_frequency_khz"    : 1144000,
+                       "hotplug,number_of_minimum_cpu" : 0,
+                       "hotplug,number_of_maximum_cpu" : 2
+               }, {
+                       "level"                         : 1,
+                       "dvfs,minimum_frequency_khz"    : 1144000,
+                       "dvfs,maximum_frequency_khz"    : 1144000,
+                       "hotplug,number_of_minimum_cpu" : 2,
+                       "hotplug,number_of_maximum_cpu" : 2
+               }, {
+                       "level"                         : 2,
+                       "dvfs,minimum_frequency_khz"    : 449000,
+                       "dvfs,maximum_frequency_khz"    : 449000,
+                       "hotplug,number_of_minimum_cpu" : 0,
+                       "hotplug,number_of_maximum_cpu" : 1
+               }, {
+                       "level"                         : 3,
+                       "dvfs,minimum_frequency_khz"    : 449000,
+                       "dvfs,maximum_frequency_khz"    : 1014000
+               }
+       ],
+
+       "pmqos_support"                 : true,
+       "pmqos_scenario_list":
+       [
+               {
+                       "name"          : "AppLaunch",
+                       "target_level"  : 1
+               }, {
+                       "name"          : "UltraPowerSaving",
+                       "target_level"  : 2
+               }, {
+                       "name"          : "Doze",
+                       "target_level"  : 3
+               }
+       ],
+
+       "thermal_support"               : true,
+       "thermal_timer_interval_ms"     : 10000,
+       "thermal_scenario_list":
+       [
+               {
+                       "name"                  : "Release",
+                       "temperature"           : 44,
+                       "timer_interval_ms"     : 10000,
+                       "target_level"          : 0
+               }, {
+                       "name"                  : "Warning",
+                       "temperature"           : 46,
+                       "timer_interval_ms"     : 5000
+               }, {
+                       "name"                  : "LimitAction",
+                       "temperature"           : 48,
+                       "timer_interval_ms"     : 3000
+               }, {
+                       "name"                  : "Shutdown",
+                       "temperature"           : 53,
+                       "timer_interval_ms"     : 1000
+               }
+       ],
+
+       "cpuhp_support"                 : false
+}
diff --git a/scripts/pass-resource1.conf b/scripts/pass-resource1.conf
deleted file mode 100644 (file)
index d7a8ecb..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-[Pass]
-pass_support=1
-pass_gov_type=0
-
-pass_num_scenario_levels=2
-pass_init_scenario_level=0
-
-####################################################
-### Scenario Level for PMQoS and Thermal Monitor ###
-####################################################
-[ScenarioLevel0]
-fault_around_bytes=4096
-
-[ScenarioLevel1]
-fault_around_bytes=65536
-
-#########################
-### Scenario of PMQoS ###
-#########################
-[PassScenario]
-pass_scenario_support=yes
-pass_num_scenarios=3
-
-[Scenario0]
-name=AppLaunch
-support=yes
-scenario_level=1
-
-[Scenario1]
-name=UltraPowerSaving
-support=yes
-scenario_level=0
-
-[Scenario2]
-name=Doze
-support=no
-scenario_level=0
diff --git a/scripts/pass-resource1.json b/scripts/pass-resource1.json
new file mode 100644 (file)
index 0000000..a3b2d28
--- /dev/null
@@ -0,0 +1,33 @@
+{
+       "support"               : true,
+       "init_level"            : 0,
+       "level_list"            :
+       [
+               {
+                       "level"                         : 0,
+                       "memory,fault_around_bytes"     : 4096
+               }, {
+                       "level"                         : 1,
+                       "memory,fault_around_bytes"     : 65536
+               }
+       ],
+
+       "pmqos_support"         : true,
+       "pmqos_scenario_list"   :
+       [
+               {
+                       "name"          : "AppLaunch",
+                       "target_level"  : 1
+               }, {
+                       "name"          : "UltraPowerSaving",
+                       "target_level"  : 0
+               }, {
+                       "name"          : "Doze",
+                       "target_level"  : 0
+               }
+       ],
+
+       "thermal_support"       : false,
+
+       "cpuhp_support"         : false
+}
diff --git a/scripts/pass-resource2.conf b/scripts/pass-resource2.conf
deleted file mode 100644 (file)
index 9f0c779..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-[Pass]
-pass_support=1
-pass_gov_type=1
-
-pass_num_levels=1
-pass_init_level=0
-pass_min_level=0
-pass_max_level=0
-
-[Level0]
-#empty
-
-############################
-### Add list of scenario ###
-############################
-[PassScenario]
-pass_scenario_support=yes
-pass_num_scenarios=2
-
-[Scenario0]
-name=AppLaunch
-support=yes
-
-[Scenario1]
-name=UltraPowerSaving
-support=yes
diff --git a/scripts/pass.conf b/scripts/pass.conf
deleted file mode 100644 (file)
index 3397edf..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# Default pass.conf
-# - If you want to use PASS(Power Aware System Service), you have to create
-# new 'pass-[target type].conf' configuration file.
-[PassResource]
-pass_compatible=GALILEO
-pass_path_compatible=/sys/devices/system/cpu/cpufreq/pmqos/device_name
-pass_num_resources=3
-
-[PassResource0]
-pass_res_type=cpu
-pass_res_name=cpu0
-pass_res_thermal_name=ap_therm
-pass_path_conf_file=/hal/etc/pass/pass-resource0.conf
-pass_first_cpu=0
-pass_num_cpus=2
-
-[PassResource1]
-pass_res_type=memory
-pass_res_name=memory
-pass_path_conf_file=/hal/etc/pass/pass-resource1.conf
-
-[PassResource2]
-pass_res_type=nonstandard
-pass_res_name=trm
-pass_path_conf_file=/hal/etc/pass/pass-resource2.conf
diff --git a/scripts/pass.json b/scripts/pass.json
new file mode 100644 (file)
index 0000000..67d1892
--- /dev/null
@@ -0,0 +1,20 @@
+{
+       "board_name"            : "GALILEO",
+       "board_name_path"       : "/sys/devices/system/cpu/cpufreq/pmqos/device_name",
+       "device_list"           :
+       [
+               {
+                       "device_type"           : "cpu",
+                       "device_name"           : "cpu0",
+                       "device_config_path"    : "/hal/etc/pass/pass-resource0.json",
+                       "thermal_device_name"   : "ap_therm",
+                       "cpu,number_of_cpus"    : 2,
+                       "cpu,first_cpu"         : 0,
+                       "cpu,cpu_load_path"     : null
+               }, {
+                       "device_type"           : "memory",
+                       "device_name"           : "memory",
+                       "device_config_path"    : "/hal/etc/pass/pass-resource1.json"
+               }
+       ]
+}