Skip to content

Commit e64d1e0

Browse files
authored
Add traceSTARTING_SCHEDULER tracing hook. (#1082)
* Add traceSTARTING_SCHEDULER tracing hook. Discussed here: https://forums.freertos.org/t/tracing-improvements/20097 This hook enables tracers to run code on startup after all RTOS resources are created and to detect that the scheduler is starting without relying on traceENTER/traceEXIT macros. It also provides tracers access to the task handle of all IDLE tasks, allowing them to be identified unambiguously and without relying on INCLUDE_xTaskGetIdleTaskHandle.
1 parent bee9037 commit e64d1e0

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

include/FreeRTOS.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,13 @@
621621
#define traceTASK_SWITCHED_IN()
622622
#endif
623623

624+
#ifndef traceSTARTING_SCHEDULER
625+
626+
/* Called after all idle tasks and timer task (if enabled) have been created
627+
* successfully, just before the scheduler is started. */
628+
#define traceSTARTING_SCHEDULER( xIdleTaskHandles )
629+
#endif
630+
624631
#ifndef traceINCREASE_TICK_COUNT
625632

626633
/* Called before stepping the tick count after waking from tickless idle

tasks.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,6 +3732,8 @@ void vTaskStartScheduler( void )
37323732

37333733
traceTASK_SWITCHED_IN();
37343734

3735+
traceSTARTING_SCHEDULER( xIdleTaskHandles );
3736+
37353737
/* Setting up the timer tick is hardware specific and thus in the
37363738
* portable interface. */
37373739

0 commit comments

Comments
 (0)