diff --git a/subsys/tracing/Kconfig b/subsys/tracing/Kconfig index bac360283b1..5e3d349345b 100644 --- a/subsys/tracing/Kconfig +++ b/subsys/tracing/Kconfig @@ -354,6 +354,12 @@ config TRACING_GPIO help Enable tracing GPIO. +config TRACING_IDLE + bool "Tracing Idle" + default y + help + Enable tracing Idle state. + endmenu # Tracing Configuration endif diff --git a/subsys/tracing/ctf/ctf_top.c b/subsys/tracing/ctf/ctf_top.c index 7acb422f3ef..753c1693111 100644 --- a/subsys/tracing/ctf/ctf_top.c +++ b/subsys/tracing/ctf/ctf_top.c @@ -189,7 +189,9 @@ void sys_trace_isr_exit_to_scheduler(void) void sys_trace_idle(void) { +#ifdef CONFIG_TRACING_IDLE ctf_top_idle(); +#endif if (IS_ENABLED(CONFIG_CPU_LOAD)) { cpu_load_on_enter_idle(); } diff --git a/subsys/tracing/sysview/sysview.c b/subsys/tracing/sysview/sysview.c index 660181e967e..42059fb0f5d 100644 --- a/subsys/tracing/sysview/sysview.c +++ b/subsys/tracing/sysview/sysview.c @@ -64,7 +64,9 @@ void sys_trace_isr_exit_to_scheduler(void) void sys_trace_idle(void) { +#ifdef CONFIG_TRACING_IDLE SEGGER_SYSVIEW_OnIdle(); +#endif if (IS_ENABLED(CONFIG_CPU_LOAD)) { cpu_load_on_enter_idle(); diff --git a/subsys/tracing/test/tracing_string_format_test.c b/subsys/tracing/test/tracing_string_format_test.c index 8a53e0bcdb8..c0ceb81114b 100644 --- a/subsys/tracing/test/tracing_string_format_test.c +++ b/subsys/tracing/test/tracing_string_format_test.c @@ -201,12 +201,16 @@ void sys_trace_isr_exit_to_scheduler(void) void sys_trace_idle(void) { +#ifdef CONFIG_TRACING_IDLE TRACING_STRING("%s\n", __func__); +#endif } void sys_trace_idle_exit(void) { +#ifdef CONFIG_TRACING_IDLE TRACING_STRING("%s\n", __func__); +#endif } void sys_trace_k_condvar_broadcast_enter(struct k_condvar *condvar)