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.
pull/1088/head^2
Philipp Schilk 9 months ago committed by GitHub
parent bee9037c46
commit e64d1e06b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -621,6 +621,13 @@
#define traceTASK_SWITCHED_IN() #define traceTASK_SWITCHED_IN()
#endif #endif
#ifndef traceSTARTING_SCHEDULER
/* Called after all idle tasks and timer task (if enabled) have been created
* successfully, just before the scheduler is started. */
#define traceSTARTING_SCHEDULER( xIdleTaskHandles )
#endif
#ifndef traceINCREASE_TICK_COUNT #ifndef traceINCREASE_TICK_COUNT
/* Called before stepping the tick count after waking from tickless idle /* Called before stepping the tick count after waking from tickless idle

@ -3732,6 +3732,8 @@ void vTaskStartScheduler( void )
traceTASK_SWITCHED_IN(); traceTASK_SWITCHED_IN();
traceSTARTING_SCHEDULER( xIdleTaskHandles );
/* Setting up the timer tick is hardware specific and thus in the /* Setting up the timer tick is hardware specific and thus in the
* portable interface. */ * portable interface. */

Loading…
Cancel
Save