File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ .. _cpu_load :
2+
3+ CPU load
4+ ########
5+
6+ Module can be used to track how much time is spent in idle. It is using tracing hooks
7+ which are called before and after CPU goes to idle. Compared to :ref: `thread_analyzer `
8+ it is more accurate since it takes into account time spent in the interrupt context as well.
9+
10+ Function :c:func: `cpu_load_get ` is used to get the latest value. It is also used to reset
11+ the measurement. By default, module is using :c:func: `k_cycle_get_32 ` but in cases when higher
12+ precision is needed a :ref: `counter_api ` device can be used.
13+
14+ Load can also be reported periodically using a logging message. Period is configured using :kconfig:option: `CONFIG_CPU_LOAD_LOG_PERIODICALLY `.
15+
16+ Using counter device
17+ ********************
18+
19+ In order to use :ref: `counter_api ` device :kconfig:option: `CONFIG_CPU_LOAD_USE_COUNTER ` must be
20+ enabled and chosen in devicetree must be set.
21+
22+ .. code-block :: devicetree
23+
24+ chosen {
25+ zephyr,cpu-load-counter = &counter_device;
26+ };
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ Debugging
77 :maxdepth: 1
88
99 thread-analyzer.rst
10+ cpu_load.rst
1011 coredump.rst
1112 gdbstub.rst
1213 debugmon.rst
You can’t perform that action at this time.
0 commit comments