From ab558f5f97221d287c2d5b24e6aaa2e56179335c Mon Sep 17 00:00:00 2001 From: schilkp Date: Thu, 6 Jun 2024 12:14:03 +0200 Subject: [PATCH] Add extended versions of all notify / notify give tracing hooks. The previous versions of these macros did not hygienically expose what task was being notified, and how/if the notification value was notified. --- include/FreeRTOS.h | 21 +++++++++++++++++++++ tasks.c | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/include/FreeRTOS.h b/include/FreeRTOS.h index f27518497..eba66a879 100644 --- a/include/FreeRTOS.h +++ b/include/FreeRTOS.h @@ -1021,14 +1021,35 @@ #define traceTASK_NOTIFY( uxIndexToNotify ) #endif +#ifndef traceTASK_NOTIFY_EXT + +/* Extended version of traceTASK_NOTIFY that also exposes the task being + * notified, and if/how the notification value was modified. */ + #define traceTASK_NOTIFY_EXT( pxTCB, uxIndexToNotify, eAction, xReturn ) traceTASK_NOTIFY( uxIndexToNotify ) +#endif + #ifndef traceTASK_NOTIFY_FROM_ISR #define traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify ) #endif +#ifndef traceTASK_NOTIFY_FROM_ISR_EXT + +/* Extended version of traceTASK_NOTIFY_FROM_ISR that also exposes the task + * being notified, and if/how the notification value was modified. */ + #define traceTASK_NOTIFY_FROM_ISR_EXT( pxTCB, uxIndexToNotify, eAction, xReturn ) traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify ) +#endif + #ifndef traceTASK_NOTIFY_GIVE_FROM_ISR #define traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify ) #endif +#ifndef traceTASK_NOTIFY_GIVE_FROM_ISR_EXT + +/* Extended version of traceTASK_NOTIFY_GIVE_FROM_ISR that also exposes the task + * being notified. */ + #define traceTASK_NOTIFY_GIVE_FROM_ISR_EXT( pxTCB, uxIndexToNotify ) traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify ) +#endif + #ifndef traceTASK_NOTIFY_STATE_CLEAR #define traceTASK_NOTIFY_STATE_CLEAR( pxTCB, uxIndexToNotify ) #endif diff --git a/tasks.c b/tasks.c index b98c23db7..e8387be94 100644 --- a/tasks.c +++ b/tasks.c @@ -7903,7 +7903,7 @@ TickType_t uxTaskResetEventItemValue( void ) break; } - traceTASK_NOTIFY( uxIndexToNotify ); + traceTASK_NOTIFY_EXT( pxTCB, uxIndexToNotify, eAction, xReturn ); /* If the task is in the blocked state specifically to wait for a * notification then unblock it now. */ @@ -8045,7 +8045,7 @@ TickType_t uxTaskResetEventItemValue( void ) break; } - traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify ); + traceTASK_NOTIFY_FROM_ISR_EXT( pxTCB, uxIndexToNotify, eAction, xReturn ); /* If the task is in the blocked state specifically to wait for a * notification then unblock it now. */