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
path: root/list.c
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 /list.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 'list.c')
-rw-r--r--list.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/list.c b/list.c
index 649c4c302..ab5bf5653 100644
--- a/list.c
+++ b/list.c
@@ -49,6 +49,8 @@
void vListInitialise( List_t * const pxList )
{
+ traceENTER_vListInitialise( pxList );
+
/* The list structure contains a list item which is used to mark the
* end of the list. To initialise the list the list end is inserted
* as the only list entry. */
@@ -80,11 +82,15 @@ void vListInitialise( List_t * const pxList )
* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList );
listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList );
+
+ traceRETURN_vListInitialise();
}
/*-----------------------------------------------------------*/
void vListInitialiseItem( ListItem_t * const pxItem )
{
+ traceENTER_vListInitialiseItem( pxItem );
+
/* Make sure the list item is not recorded as being on a list. */
pxItem->pxContainer = NULL;
@@ -92,6 +98,8 @@ void vListInitialiseItem( ListItem_t * const pxItem )
* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
+
+ traceRETURN_vListInitialiseItem();
}
/*-----------------------------------------------------------*/
@@ -100,6 +108,8 @@ void vListInsertEnd( List_t * const pxList,
{
ListItem_t * const pxIndex = pxList->pxIndex;
+ traceENTER_vListInsertEnd( pxList, pxNewListItem );
+
/* Only effective when configASSERT() is also defined, these tests may catch
* the list data structures being overwritten in memory. They will not catch
* data errors caused by incorrect configuration or use of FreeRTOS. */
@@ -122,6 +132,8 @@ void vListInsertEnd( List_t * const pxList,
pxNewListItem->pxContainer = pxList;
( pxList->uxNumberOfItems )++;
+
+ traceRETURN_vListInsertEnd();
}
/*-----------------------------------------------------------*/
@@ -131,6 +143,8 @@ void vListInsert( List_t * const pxList,
ListItem_t * pxIterator;
const TickType_t xValueOfInsertion = pxNewListItem->xItemValue;
+ traceENTER_vListInsert( pxList, pxNewListItem );
+
/* Only effective when configASSERT() is also defined, these tests may catch
* the list data structures being overwritten in memory. They will not catch
* data errors caused by incorrect configuration or use of FreeRTOS. */
@@ -193,15 +207,21 @@ void vListInsert( List_t * const pxList,
pxNewListItem->pxContainer = pxList;
( pxList->uxNumberOfItems )++;
+
+ traceRETURN_vListInsert();
}
/*-----------------------------------------------------------*/
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
{
-/* The list item knows which list it is in. Obtain the list from the list
- * item. */
+ /* The list item knows which list it is in. Obtain the list from the list
+ * item. */
List_t * const pxList = pxItemToRemove->pxContainer;
+ traceENTER_uxListRemove( pxItemToRemove );
+
+
+
pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;
@@ -221,6 +241,8 @@ UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
pxItemToRemove->pxContainer = NULL;
( pxList->uxNumberOfItems )--;
+ traceRETURN_uxListRemove( pxList->uxNumberOfItems );
+
return pxList->uxNumberOfItems;
}
/*-----------------------------------------------------------*/