Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FreeRTOS/FreeRTOS-Kernel.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Brosch <9060129+Techcore123@users.noreply.github.com>2023-09-20 13:17:42 +0300
committerGitHub <noreply@github.com>2023-09-20 13:17:42 +0300
commit83861f5b1def1e4a3e1ea75562446f06e5b4359e (patch)
tree2f030beb72c7712a4e4425e37373a4ff46ad0742 /croutine.c
parent15e0364968aff9c6c3cc7b4893e8ec0311047ce2 (diff)
Add Trace Hook Macros to all API calls (#786)
This pull-request adds out-of-the-box support for different tracing tools. New trace hook macros have been added for all public API functions, one for each function entry and one for each exit. There are no functional changes, as the macros are by default empty. For more information see following forum post: https://forums.freertos.org/t/add-tracing-functionality-for-all-api-calls/18007.
Diffstat (limited to 'croutine.c')
-rw-r--r--croutine.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/croutine.c b/croutine.c
index 8969dc89b..f7d8ab95d 100644
--- a/croutine.c
+++ b/croutine.c
@@ -107,6 +107,8 @@
BaseType_t xReturn;
CRCB_t * pxCoRoutine;
+ traceENTER_xCoRoutineCreate( pxCoRoutineCode, uxPriority, uxIndex );
+
/* Allocate the memory that will store the co-routine control block. */
pxCoRoutine = ( CRCB_t * ) pvPortMalloc( sizeof( CRCB_t ) );
@@ -156,6 +158,8 @@
xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
}
+ traceRETURN_xCoRoutineCreate( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
@@ -165,6 +169,8 @@
{
TickType_t xTimeToWake;
+ traceENTER_vCoRoutineAddToDelayedList( xTicksToDelay, pxEventList );
+
/* Calculate the time to wake - this may overflow but this is
* not a problem. */
xTimeToWake = xCoRoutineTickCount + xTicksToDelay;
@@ -196,6 +202,8 @@
* function must be called with interrupts disabled. */
vListInsert( pxEventList, &( pxCurrentCoRoutine->xEventListItem ) );
}
+
+ traceRETURN_vCoRoutineAddToDelayedList();
}
/*-----------------------------------------------------------*/
@@ -283,6 +291,8 @@
void vCoRoutineSchedule( void )
{
+ traceENTER_vCoRoutineSchedule();
+
/* Only run a co-routine after prvInitialiseCoRoutineLists() has been
* called. prvInitialiseCoRoutineLists() is called automatically when a
* co-routine is created. */
@@ -313,6 +323,8 @@
/* Call the co-routine. */
( pxCurrentCoRoutine->pxCoRoutineFunction )( pxCurrentCoRoutine, pxCurrentCoRoutine->uxIndex );
}
+
+ traceRETURN_vCoRoutineSchedule();
}
/*-----------------------------------------------------------*/
@@ -341,6 +353,8 @@
CRCB_t * pxUnblockedCRCB;
BaseType_t xReturn;
+ traceENTER_xCoRoutineRemoveFromEventList( pxEventList );
+
/* This function is called from within an interrupt. It can only access
* event lists and the pending ready list. This function assumes that a
* check has already been made to ensure pxEventList is not empty. */
@@ -357,6 +371,8 @@
xReturn = pdFALSE;
}
+ traceRETURN_xCoRoutineRemoveFromEventList( xReturn );
+
return xReturn;
}