-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add Trace Hook Macros and function that returns the start of the stack. #659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
d8ca0e1
8bae910
92cd939
1ecf24c
dad7a5e
3121075
b500794
7b3efdd
6f509d7
5f8c75d
fe2965e
6248d98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,7 +94,7 @@ | |
|
||
#define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) ) | ||
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL ) | ||
#define portEND_SWITCHING_ISR( xSwitchRequired ) do { if( xSwitchRequired != pdFALSE ) portYIELD(); } while( 0 ) | ||
#define portEND_SWITCHING_ISR( xSwitchRequired ) do { if( xSwitchRequired != pdFALSE ) { traceISR_EXIT_TO_SCHEDULER(); portYIELD(); } else { traceISR_EXIT(); } } while( 0 ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit only - I wonder if this could result in confusion when reading the resultant trace if the interrupts is preempted between the execution of the trace macro and the portYIELD. |
||
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x ) | ||
/*-----------------------------------------------------------*/ | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1708,6 +1708,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) | |
mtCOVERAGE_TEST_MARKER(); | ||
} | ||
|
||
traceMOVED_TASK_TO_SUSPENDED_LIST(pxTCB); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this macro needed? A few lines earlier is the traceTASK_SUSPEND(pxTCB) macro (line 1688) So we already know that the function is called and the task is being suspended. Is it necessary to know that the suspension is happening 23 lines of code later? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree this macro is not necessarily needed. |
||
vListInsertEnd( &xSuspendedTaskList, &( pxTCB->xStateListItem ) ); | ||
|
||
#if ( configUSE_TASK_NOTIFICATIONS == 1 ) | ||
|
@@ -3988,6 +3989,21 @@ static void prvCheckTasksWaitingTermination( void ) | |
#endif /* INCLUDE_uxTaskGetStackHighWaterMark */ | ||
/*-----------------------------------------------------------*/ | ||
|
||
#if (INCLUDE_pxTaskGetStackStart == 1) | ||
uint8_t* pxTaskGetStackStart( TaskHandle_t xTask) | ||
{ | ||
TCB_t *pxTCB; | ||
UBaseType_t uxReturn; | ||
(void)uxReturn; | ||
|
||
pxTCB = prvGetTCBFromHandle( xTask ); | ||
return ( uint8_t * ) pxTCB->pxStack; | ||
} | ||
|
||
#endif /* INCLUDE_pxTaskGetStackStart */ | ||
/*-----------------------------------------------------------*/ | ||
|
||
|
||
#if ( INCLUDE_vTaskDelete == 1 ) | ||
|
||
static void prvDeleteTCB( TCB_t * pxTCB ) | ||
|
@@ -5412,12 +5428,14 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait, | |
{ | ||
/* Wake time has overflowed. Place this item in the overflow | ||
* list. */ | ||
traceMOVED_TASK_TO_OVERFLOW_DELAYED_LIST(); | ||
vListInsert( pxOverflowDelayedTaskList, &( pxCurrentTCB->xStateListItem ) ); | ||
} | ||
else | ||
{ | ||
/* The wake time has not overflowed, so the current block list | ||
* is used. */ | ||
traceMOVED_TASK_TO_DELAYED_LIST(); | ||
vListInsert( pxDelayedTaskList, &( pxCurrentTCB->xStateListItem ) ); | ||
|
||
/* If the task entering the blocked state was placed at the | ||
|
@@ -5446,11 +5464,13 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait, | |
|
||
if( xTimeToWake < xConstTickCount ) | ||
{ | ||
traceMOVED_TASK_TO_OVERFLOW_DELAYED_LIST(); | ||
/* Wake time has overflowed. Place this item in the overflow list. */ | ||
vListInsert( pxOverflowDelayedTaskList, &( pxCurrentTCB->xStateListItem ) ); | ||
} | ||
else | ||
{ | ||
traceMOVED_TASK_TO_DELAYED_LIST(); | ||
/* The wake time has not overflowed, so the current block list is used. */ | ||
vListInsert( pxDelayedTaskList, &( pxCurrentTCB->xStateListItem ) ); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can get this information using vTaskGetInfo API -
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Removed it from the patchset.