zephyr/subsys/tracing/tracing_none.c
Krzysztof Chruściński 4cbafc6bd4 tracing: Add sys_trace_idle_exit call
Add new tracing API which is called when core is exiting from idle.
Current implementation is using it to track CPU load. Implementation
in tracing_none is now weak so it can be used if given backend does
not support new API call.

When CONFIG_CPU_LOAD is enabled then sys_trace_idle also calls a
hook which stores the timing information when CPU entered idle.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-03-12 14:03:48 +00:00

28 lines
511 B
C

/*
* Copyright (c) 2019 Intel corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/tracing/tracing.h>
#include <zephyr/debug/cpu_load.h>
__weak void sys_trace_isr_enter(void) {}
__weak void sys_trace_isr_exit(void) {}
__weak void sys_trace_isr_exit_to_scheduler(void) {}
__weak void sys_trace_idle(void)
{
if (IS_ENABLED(CONFIG_CPU_LOAD)) {
cpu_load_on_enter_idle();
}
}
__weak void sys_trace_idle_exit(void)
{
if (IS_ENABLED(CONFIG_CPU_LOAD)) {
cpu_load_on_exit_idle();
}
}