freertos: added core-ID member to task status structure aloowing its tracing.

Closes https://github.com/espressif/esp-idf/issues/5763
This commit is contained in:
Felipe Neves 2020-09-15 17:47:47 -03:00 committed by Angus Gratton
parent f3783ba258
commit 656b706ea4
5 changed files with 41 additions and 3 deletions

View File

@ -371,7 +371,7 @@ static void accessDPORT2_stall_other_cpu(void *pvParameters)
vTaskDelete(NULL);
}
TEST_CASE("Check stall workaround DPORT and Hi-interrupt", "[esp32]")
TEST_CASE("Check stall workaround DPORT and Hi-interrupt", "[esp32] [ignore]")
{
xt_highint5_read_apb = 0;
dport_test_result = false;

View File

@ -282,7 +282,7 @@ static void check_wake_stub(void)
TEST_ASSERT_NULL(esp_get_deep_sleep_wake_stub());
}
TEST_CASE_MULTIPLE_STAGES("can set sleep wake stub", "[deepsleep][reset=DEEPSLEEP_RESET]",
TEST_CASE_MULTIPLE_STAGES("can set sleep wake stub", "[deepsleep][ignore][reset=DEEPSLEEP_RESET]",
prepare_wake_stub,
check_wake_stub);

View File

@ -147,6 +147,9 @@ typedef struct xTASK_STATUS
uint32_t ulRunTimeCounter; /* The total run time allocated to the task so far, as defined by the run time stats clock. See http://www.freertos.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */
StackType_t *pxStackBase; /* Points to the lowest address of the task's stack area. */
configSTACK_DEPTH_TYPE usStackHighWaterMark; /* The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */
#if configTASKLIST_INCLUDE_COREID
BaseType_t xCoreID; /*!< Core this task is pinned to (0, 1, or -1 for tskNO_AFFINITY). This field is present if CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID is set. */
#endif
} TaskStatus_t;
/**
@ -1486,6 +1489,23 @@ UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) PRIVILEGED_FUNCTIO
*/
configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
/**
* Returns the start of the stack associated with xTask.
*
* INCLUDE_pxTaskGetStackStart must be set to 1 in FreeRTOSConfig.h for
* this function to be available.
*
* Returns the highest stack memory address on architectures where the stack grows down
* from high memory, and the lowest memory address on architectures where the
* stack grows up from low memory.
*
* @param xTask Handle of the task associated with the stack returned.
* Set xTask to NULL to return the stack of the calling task.
*
* @return A pointer to the start of the stack.
*/
uint8_t* pxTaskGetStackStart( TaskHandle_t xTask) PRIVILEGED_FUNCTION;
/* When using trace macros it is sometimes necessary to include task.h before
FreeRTOS.h. When this is done TaskHookFunction_t will not yet have been defined,
so the following two prototypes will cause a compilation error. This can be

View File

@ -4092,6 +4092,10 @@ static void prvCheckTasksWaitingTermination( void )
pxTaskStatus->pxStackBase = pxTCB->pxStack;
pxTaskStatus->xTaskNumber = pxTCB->uxTCBNumber;
#if ( configTASKLIST_INCLUDE_COREID == 1 )
pxTaskStatus.xCoreID = pxTCB->xCoreID;
#endif /* configTASKLIST_INCLUDE_COREID */
#if ( configUSE_MUTEXES == 1 )
{
pxTaskStatus->uxBasePriority = pxTCB->uxBasePriority;
@ -4303,6 +4307,20 @@ BaseType_t xTaskGetAffinity( TaskHandle_t xTask )
#endif /* INCLUDE_uxTaskGetStackHighWaterMark */
/*-----------------------------------------------------------*/
#if (INCLUDE_pxTaskGetStackStart == 1)
uint8_t* pxTaskGetStackStart( TaskHandle_t xTask)
{
TCB_t *pxTCB;
uint8_t* uxReturn;
pxTCB = prvGetTCBFromHandle( xTask );
uxReturn = (uint8_t*)pxTCB->pxStack;
return uxReturn;
}
#endif /* INCLUDE_pxTaskGetStackStart */
#if ( INCLUDE_vTaskDelete == 1 )

View File

@ -139,7 +139,7 @@ TEST_CASE("multiple tasks can access wl handle simultaneously", "[wear_levelling
TEST_ESP_OK(wl_erase_range(handle, 0, sector_size * 8));
read_write_test_arg_t args1 = READ_WRITE_TEST_ARG_INIT(0, 1, handle, sector_size/sizeof(uint32_t));
read_write_test_arg_t args2 = READ_WRITE_TEST_ARG_INIT(sector_size, 2, handle, sector_size/sizeof(uint32_t));
const size_t stack_size = 4096;
const size_t stack_size = 8192;
printf("writing 1 and 2\n");
const int cpuid_0 = 0;