mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
sysview: Fixes IDLE tasks detection via name comparison
This commit is contained in:
parent
4a266d165b
commit
030f3b7534
@ -142,7 +142,11 @@ static U64 _cbGetTime(void) {
|
|||||||
void SYSVIEW_AddTask(U32 xHandle, const char* pcTaskName, unsigned uxCurrentPriority, U32 pxStack, unsigned uStackHighWaterMark) {
|
void SYSVIEW_AddTask(U32 xHandle, const char* pcTaskName, unsigned uxCurrentPriority, U32 pxStack, unsigned uStackHighWaterMark) {
|
||||||
unsigned n;
|
unsigned n;
|
||||||
|
|
||||||
if (memcmp(pcTaskName, "IDLE", 5) == 0) {
|
/* On multi-core we have several idle tasks with 'IDLEx' names
|
||||||
|
Not best solution, because we can filter out user tasks starting with 'IDLE'.
|
||||||
|
But we can not use 'xTaskGetIdleTaskHandle' because at the moment when this
|
||||||
|
function is called array of idle tasks handles are not initialized yet. */
|
||||||
|
if (memcmp(pcTaskName, "IDLE", 4) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,7 +180,11 @@ void SYSVIEW_AddTask(U32 xHandle, const char* pcTaskName, unsigned uxCurrentPrio
|
|||||||
void SYSVIEW_UpdateTask(U32 xHandle, const char* pcTaskName, unsigned uxCurrentPriority, U32 pxStack, unsigned uStackHighWaterMark) {
|
void SYSVIEW_UpdateTask(U32 xHandle, const char* pcTaskName, unsigned uxCurrentPriority, U32 pxStack, unsigned uStackHighWaterMark) {
|
||||||
unsigned n;
|
unsigned n;
|
||||||
|
|
||||||
if (memcmp(pcTaskName, "IDLE", 5) == 0) {
|
/* On multi-core we have several idle tasks with 'IDLEx' names
|
||||||
|
Not best solution, because we can filter out user tasks starting with 'IDLE'.
|
||||||
|
But we can not use 'xTaskGetIdleTaskHandle' because at the moment when this
|
||||||
|
function is called array of idle tasks handles are not initialized yet. */
|
||||||
|
if (memcmp(pcTaskName, "IDLE", 4) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,8 +346,8 @@ define away all of the tracing macros.
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define traceTASK_SWITCHED_IN() { \
|
#define traceTASK_SWITCHED_IN() { \
|
||||||
if (memcmp(pxCurrentTCB[esp_cpu_get_core_id()]->pcTaskName, "IDLE", 5) != 0) { \
|
if (memcmp(prvGetTCBFromHandle(NULL)->pcTaskName, "IDLE", 4) != 0) { \
|
||||||
SEGGER_SYSVIEW_OnTaskStartExec((U32)pxCurrentTCB[esp_cpu_get_core_id()]); \
|
SEGGER_SYSVIEW_OnTaskStartExec((U32)prvGetTCBFromHandle(NULL)); \
|
||||||
} else { \
|
} else { \
|
||||||
SEGGER_SYSVIEW_OnIdle(); \
|
SEGGER_SYSVIEW_OnIdle(); \
|
||||||
} \
|
} \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user