Branch data Line data Source code
1 : : /*
2 : : * Copyright (c) 2019 Intel corporation
3 : : *
4 : : * SPDX-License-Identifier: Apache-2.0
5 : : */
6 : : #include <zephyr/sys/util.h>
7 : : #include <zephyr/tracing/tracing.h>
8 : : #include <zephyr/sys/cpu_load.h>
9 : :
10 : 0 : __weak void sys_trace_isr_enter(void)
11 : : {
12 : 0 : if (IS_ENABLED(CONFIG_CPU_LOAD_BACKEND_IDLE_HOOK)) {
13 : : /* On architectures that wait for the interrupt with interrupts
14 : : * enabled, this is what actually closes the idle window: the
15 : : * idle-exit hook would run too late. It is a no-op when the CPU
16 : : * was not idle.
17 : : */
18 : : cpu_load_on_exit_idle();
19 : : }
20 : 0 : }
21 : :
22 : 0 : __weak void sys_trace_isr_exit(void) {}
23 : :
24 : 0 : __weak void sys_trace_isr_exit_to_scheduler(void) {}
25 : :
26 : 0 : __weak void sys_trace_idle(void)
27 : : {
28 : 0 : if (IS_ENABLED(CONFIG_CPU_LOAD_BACKEND_IDLE_HOOK)) {
29 : : cpu_load_on_enter_idle();
30 : : }
31 : 0 : }
32 : :
33 : 0 : __weak void sys_trace_idle_exit(void)
34 : : {
35 : 0 : if (IS_ENABLED(CONFIG_CPU_LOAD_BACKEND_IDLE_HOOK)) {
36 : : cpu_load_on_exit_idle();
37 : : }
38 : 0 : }
|