Skip to content

Commit dcdc7d3

Browse files
ksychladkalowsk
authored andcommitted
tracing: Allow disabling idle traces
This change allows for enabling/disabling the idle traces by setting the CONFIG_TRACING_IDLE config. Signed-off-by: Krzysztof Sychla <ksychla@antmicro.com>
1 parent f503313 commit dcdc7d3

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

subsys/tracing/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,12 @@ config TRACING_GPIO
354354
help
355355
Enable tracing GPIO.
356356

357+
config TRACING_IDLE
358+
bool "Tracing Idle"
359+
default y
360+
help
361+
Enable tracing Idle state.
362+
357363
endmenu # Tracing Configuration
358364

359365
endif

subsys/tracing/ctf/ctf_top.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ void sys_trace_isr_exit_to_scheduler(void)
189189

190190
void sys_trace_idle(void)
191191
{
192+
#ifdef CONFIG_TRACING_IDLE
192193
ctf_top_idle();
194+
#endif
193195
if (IS_ENABLED(CONFIG_CPU_LOAD)) {
194196
cpu_load_on_enter_idle();
195197
}

subsys/tracing/sysview/sysview.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ void sys_trace_isr_exit_to_scheduler(void)
6464

6565
void sys_trace_idle(void)
6666
{
67+
#ifdef CONFIG_TRACING_IDLE
6768
SEGGER_SYSVIEW_OnIdle();
69+
#endif
6870

6971
if (IS_ENABLED(CONFIG_CPU_LOAD)) {
7072
cpu_load_on_enter_idle();

subsys/tracing/test/tracing_string_format_test.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,16 @@ void sys_trace_isr_exit_to_scheduler(void)
201201

202202
void sys_trace_idle(void)
203203
{
204+
#ifdef CONFIG_TRACING_IDLE
204205
TRACING_STRING("%s\n", __func__);
206+
#endif
205207
}
206208

207209
void sys_trace_idle_exit(void)
208210
{
211+
#ifdef CONFIG_TRACING_IDLE
209212
TRACING_STRING("%s\n", __func__);
213+
#endif
210214
}
211215

212216
void sys_trace_k_condvar_broadcast_enter(struct k_condvar *condvar)

0 commit comments

Comments
 (0)