diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index a3272c770cc83..95dfc21badaf2 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -855,8 +855,6 @@ CPU Frequency Scaling: - seankyer files: - include/zephyr/cpu_freq/ - - include/zephyr/cpu_load/ - - subsys/cpu_load/ - subsys/cpu_freq/ - dts/bindings/p_state/ labels: diff --git a/doc/services/cpu_freq/policies/on_demand.rst b/doc/services/cpu_freq/policies/on_demand.rst index ea1d3e15b093a..63026bc454715 100644 --- a/doc/services/cpu_freq/policies/on_demand.rst +++ b/doc/services/cpu_freq/policies/on_demand.rst @@ -4,7 +4,7 @@ On-Demand CPU Frequency Scaling Policy ###################################### The On-Demand policy evaluates the current CPU load using the -:ref:`CPU Load subsystem `, and compares it to the trigger threshold defined by the +:ref:`CPU Load metric `, and compares it to the trigger threshold defined by the SoC P-state definition. The On-Demand policy will iterate through the defined P-states and select the first P-state of which diff --git a/doc/services/cpu_load/index.rst b/doc/services/cpu_load/index.rst index 68fb257ebba20..5ed96621a05ee 100644 --- a/doc/services/cpu_load/index.rst +++ b/doc/services/cpu_load/index.rst @@ -1,4 +1,4 @@ -.. _cpu_load_subsys: +.. _cpu_load_metric: CPU Load ######## diff --git a/include/zephyr/cpu_load/cpu_load.h b/include/zephyr/sys/cpu_load.h similarity index 100% rename from include/zephyr/cpu_load/cpu_load.h rename to include/zephyr/sys/cpu_load.h diff --git a/lib/os/CMakeLists.txt b/lib/os/CMakeLists.txt index c8c56d7e07281..f609121077311 100644 --- a/lib/os/CMakeLists.txt +++ b/lib/os/CMakeLists.txt @@ -20,6 +20,7 @@ zephyr_syscall_header_ifdef(CONFIG_FDTABLE zephyr_sources_ifdef(CONFIG_CBPRINTF_COMPLETE cbprintf_complete.c) zephyr_sources_ifdef(CONFIG_CBPRINTF_NANO cbprintf_nano.c) +add_subdirectory_ifdef(CONFIG_CPU_LOAD_METRIC cpu_load) if(NOT CONFIG_PICOLIBC) zephyr_sources(cbprintf.c) diff --git a/lib/os/Kconfig b/lib/os/Kconfig index bca940023c6e5..978645f73324c 100644 --- a/lib/os/Kconfig +++ b/lib/os/Kconfig @@ -137,5 +137,6 @@ config POWEROFF rsource "Kconfig.cbprintf" rsource "zvfs/Kconfig" +rsource "cpu_load/Kconfig" endmenu diff --git a/subsys/cpu_load/CMakeLists.txt b/lib/os/cpu_load/CMakeLists.txt similarity index 100% rename from subsys/cpu_load/CMakeLists.txt rename to lib/os/cpu_load/CMakeLists.txt diff --git a/subsys/cpu_load/Kconfig b/lib/os/cpu_load/Kconfig similarity index 87% rename from subsys/cpu_load/Kconfig rename to lib/os/cpu_load/Kconfig index 7772a6695e717..4941cf8b1a47e 100644 --- a/subsys/cpu_load/Kconfig +++ b/lib/os/cpu_load/Kconfig @@ -3,14 +3,14 @@ # SPDX-License-Identifier: Apache-2.0 menuconfig CPU_LOAD_METRIC - bool "CPU Load Subsystem" + bool "CPU Load Metric" select EXPERIMENTAL select THREAD_RUNTIME_STATS select SCHED_THREAD_USAGE select SCHED_THREAD_USAGE_ALL select SCHED_THREAD_USAGE_AUTO_ENABLE help - CPU Load subsystem + Tracking of CPU load statistics. if CPU_LOAD_METRIC diff --git a/subsys/cpu_load/cpu_load.c b/lib/os/cpu_load/cpu_load.c similarity index 100% rename from subsys/cpu_load/cpu_load.c rename to lib/os/cpu_load/cpu_load.c diff --git a/subsys/CMakeLists.txt b/subsys/CMakeLists.txt index 756214ad752d4..979fb92f5f442 100644 --- a/subsys/CMakeLists.txt +++ b/subsys/CMakeLists.txt @@ -41,7 +41,6 @@ add_subdirectory_ifdef(CONFIG_BINDESC bindesc) add_subdirectory_ifdef(CONFIG_BT bluetooth) add_subdirectory_ifdef(CONFIG_CONSOLE_SUBSYS console) add_subdirectory_ifdef(CONFIG_CPU_FREQ cpu_freq) -add_subdirectory_ifdef(CONFIG_CPU_LOAD_METRIC cpu_load) add_subdirectory_ifdef(CONFIG_CRC crc) add_subdirectory_ifdef(CONFIG_DAP dap) add_subdirectory_ifdef(CONFIG_DEMAND_PAGING demand_paging) diff --git a/subsys/Kconfig b/subsys/Kconfig index f35a0d1c90680..380c0e5d94439 100644 --- a/subsys/Kconfig +++ b/subsys/Kconfig @@ -12,7 +12,6 @@ source "subsys/bluetooth/Kconfig" source "subsys/canbus/Kconfig" source "subsys/console/Kconfig" source "subsys/cpu_freq/Kconfig" -source "subsys/cpu_load/Kconfig" source "subsys/crc/Kconfig" source "subsys/dap/Kconfig" source "subsys/debug/Kconfig" diff --git a/subsys/cpu_freq/policies/on_demand/on_demand.c b/subsys/cpu_freq/policies/on_demand/on_demand.c index 41b9b733eabad..1cc1cdec78d62 100644 --- a/subsys/cpu_freq/policies/on_demand/on_demand.c +++ b/subsys/cpu_freq/policies/on_demand/on_demand.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include LOG_MODULE_REGISTER(cpu_freq_policy_on_demand, CONFIG_CPU_FREQ_LOG_LEVEL);