lib: move cpu_load into lib/os

Move cpu_load to lib/os, as this functionality on its own does not
justify being a subsystem on its own.

Fixes #95498

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif
2025-10-18 06:53:28 -04:00
committed by Benjamin Cabé
parent 70951ee985
commit 24e094ef5e
12 changed files with 7 additions and 9 deletions

View File

@@ -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:

View File

@@ -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 <cpu_load_subsys>`, and compares it to the trigger threshold defined by the
:ref:`CPU Load metric <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

View File

@@ -1,4 +1,4 @@
.. _cpu_load_subsys:
.. _cpu_load_metric:
CPU Load
########

View File

@@ -50,6 +50,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)

View File

@@ -151,5 +151,6 @@ config POWEROFF
rsource "Kconfig.cbprintf"
rsource "zvfs/Kconfig"
rsource "cpu_load/Kconfig"
endmenu

View File

@@ -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

View File

@@ -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)

View File

@@ -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"

View File

@@ -8,7 +8,7 @@
#include <zephyr/logging/log.h>
#include <zephyr/cpu_freq/policy.h>
#include <zephyr/cpu_freq/cpu_freq.h>
#include <zephyr/cpu_load/cpu_load.h>
#include <zephyr/sys/cpu_load.h>
LOG_MODULE_REGISTER(cpu_freq_policy_on_demand, CONFIG_CPU_FREQ_LOG_LEVEL);