Line data Source code
1 0 : /*
2 : * Copyright (c) 2025 Analog Devices, Inc.
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 :
7 : #ifndef ZEPHYR_SUBSYS_CPU_LOAD_H_
8 : #define ZEPHYR_SUBSYS_CPU_LOAD_H_
9 :
10 : #include <stdint.h>
11 :
12 : #ifdef __cplusplus
13 : extern "C" {
14 : #endif
15 :
16 : /**
17 : * @brief CPU Load Monitoring
18 : * @defgroup subsys_cpu_load CPU Load
19 : * @since 4.3
20 : * @version 0.1.0
21 : * @ingroup os_services
22 : * @{
23 : */
24 :
25 : /**
26 : * @brief Get the CPU load as a percentage.
27 : *
28 : * Return the percent that the CPU has spent in the active (non-idle) state between calls to this
29 : * function.
30 : *
31 : * @param cpu_id The ID of the CPU for which to get the load.
32 : *
33 : * @retval CPU load in percent (0-100) in case of success
34 : * @retval -errno code in case of failure.
35 : *
36 : */
37 1 : int cpu_load_get(int cpu_id);
38 :
39 : /**
40 : * @}
41 : */
42 :
43 : #ifdef __cplusplus
44 : }
45 : #endif
46 :
47 : #endif /* ZEPHYR_SUBSYS_CPU_LOAD_H_ */
|