From edf7adab9800aff365097de87ae3f1abaa6a089e Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Thu, 24 Oct 2024 12:21:13 +0300 Subject: [PATCH 1/7] feature(rtos): Add Tasks status print function --- cores/esp32/Arduino.h | 1 + cores/esp32/freertos_stats.cpp | 101 +++++++++++++++++++++++++++++++++ cores/esp32/freertos_stats.h | 4 ++ 3 files changed, 106 insertions(+) create mode 100644 cores/esp32/freertos_stats.cpp create mode 100644 cores/esp32/freertos_stats.h diff --git a/cores/esp32/Arduino.h b/cores/esp32/Arduino.h index 2b115505cff..ab7e497dcf6 100644 --- a/cores/esp32/Arduino.h +++ b/cores/esp32/Arduino.h @@ -199,6 +199,7 @@ void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val); #include "Udp.h" #include "HardwareSerial.h" #include "Esp.h" +#include "freertos_stats.h" // Use float-compatible stl abs() and round(), we don't use Arduino macros to avoid issues with the C++ libraries using std::abs; diff --git a/cores/esp32/freertos_stats.cpp b/cores/esp32/freertos_stats.cpp new file mode 100644 index 00000000000..832515c0821 --- /dev/null +++ b/cores/esp32/freertos_stats.cpp @@ -0,0 +1,101 @@ +#include "freertos_stats.h" +#include "sdkconfig.h" +//#undef CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID +//#undef CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS + +#if CONFIG_FREERTOS_USE_TRACE_FACILITY +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "freertos/portable.h" +#endif /* CONFIG_FREERTOS_USE_TRACE_FACILITY */ + +void printRunningTasks(Print & printer) { +#if CONFIG_FREERTOS_USE_TRACE_FACILITY +#if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS +#define FREERTOS_TASK_NUMBER_MAX_NUM 256 + static UBaseType_t ulRunTimeCounters[FREERTOS_TASK_NUMBER_MAX_NUM]; + static configRUN_TIME_COUNTER_TYPE ulLastRunTime = 0; +#endif + TaskStatus_t *pxTaskStatusArray = NULL; + volatile UBaseType_t uxArraySize = 0, x = 0; + configRUN_TIME_COUNTER_TYPE ulTotalRunTime = 0, uiCurrentRunTime = 0, uiTaskRunTime = 0; + const char * taskStates[] = { + "Running", + "Ready", + "Blocked", + "Suspended", + "Deleted", + "Invalid" + }; + + // Take a snapshot of the number of tasks in case it changes while this function is executing. + uxArraySize = uxTaskGetNumberOfTasks(); + //printer.printf("Running tasks: %u\n", uxArraySize); + + // Allocate a TaskStatus_t structure for each task. + pxTaskStatusArray = (TaskStatus_t*)pvPortMalloc( uxArraySize * sizeof( TaskStatus_t ) ); + + if( pxTaskStatusArray != NULL ) { + // Generate raw status information about each task. + uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, &ulTotalRunTime ); +#if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS + uiCurrentRunTime = ulTotalRunTime - ulLastRunTime; + ulLastRunTime = ulTotalRunTime; +#endif + printer.printf("Tasks: %u" +#if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS + ", Runtime: %us, Period: %uus" +#endif + "\n", uxArraySize +#if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS + , ulTotalRunTime / 1000000, uiCurrentRunTime +#endif + ); + printer.printf("Num\t Name" +#if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS + "\t Load" +#endif + "\tPrio\t Free" +#if CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID + "\tCore" +#endif + "\tState\r\n"); + for( x = 0; x < uxArraySize; x++ ) { +#if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS + if (pxTaskStatusArray[ x ].xTaskNumber < FREERTOS_TASK_NUMBER_MAX_NUM) { + uiTaskRunTime = (pxTaskStatusArray[ x ].ulRunTimeCounter - ulRunTimeCounters[pxTaskStatusArray[ x ].xTaskNumber]); + ulRunTimeCounters[pxTaskStatusArray[ x ].xTaskNumber] = pxTaskStatusArray[ x ].ulRunTimeCounter; + uiTaskRunTime = (uiTaskRunTime * 100) / uiCurrentRunTime; // in percentage + } else { + uiTaskRunTime = 0; + } +#endif + printer.printf("%3u\t%16s" +#if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS + "\t%8lu%%" +#endif + "\t%4u\t%5lu" +#if CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID + "\t%4c" +#endif + "\t%s\r\n", + pxTaskStatusArray[ x ].xTaskNumber, + pxTaskStatusArray[ x ].pcTaskName, +#if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS + uiTaskRunTime, +#endif + pxTaskStatusArray[ x ].uxCurrentPriority, + pxTaskStatusArray[ x ].usStackHighWaterMark, +#if CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID + (pxTaskStatusArray[ x ].xCoreID == tskNO_AFFINITY)?'*':('0'+pxTaskStatusArray[ x ].xCoreID), +#endif + taskStates[pxTaskStatusArray[ x ].eCurrentState] + ); + } + + // The array is no longer needed, free the memory it consumes. + vPortFree( pxTaskStatusArray ); + printer.println(); + } +#endif /* CONFIG_FREERTOS_USE_TRACE_FACILITY */ +} diff --git a/cores/esp32/freertos_stats.h b/cores/esp32/freertos_stats.h new file mode 100644 index 00000000000..ad14843c77b --- /dev/null +++ b/cores/esp32/freertos_stats.h @@ -0,0 +1,4 @@ +#pragma once +#include "Print.h" + +void printRunningTasks(Print & printer); From 182d3015ac8273abd4da0d8dc709c5cfd0e7e220 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Thu, 24 Oct 2024 12:25:22 +0300 Subject: [PATCH 2/7] fix(cmake): Add the new cpp file to CMakeLists --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9964d85abd0..591b0b31568 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,6 +49,7 @@ set(CORE_SRCS cores/esp32/esp32-hal-uart.c cores/esp32/esp32-hal-rmt.c cores/esp32/Esp.cpp + cores/esp32/freertos_stats.cpp cores/esp32/FunctionalInterrupt.cpp cores/esp32/HardwareSerial.cpp cores/esp32/HEXBuilder.cpp From aa0ff5f99f3cb3b58c5de49c5d9aa93bb3b75d3f Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Thu, 24 Oct 2024 12:53:24 +0300 Subject: [PATCH 3/7] fix(stats): Adjust size of Load column --- cores/esp32/freertos_stats.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cores/esp32/freertos_stats.cpp b/cores/esp32/freertos_stats.cpp index 832515c0821..60305e07333 100644 --- a/cores/esp32/freertos_stats.cpp +++ b/cores/esp32/freertos_stats.cpp @@ -53,7 +53,7 @@ void printRunningTasks(Print & printer) { ); printer.printf("Num\t Name" #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS - "\t Load" + "\tLoad" #endif "\tPrio\t Free" #if CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID @@ -72,7 +72,7 @@ void printRunningTasks(Print & printer) { #endif printer.printf("%3u\t%16s" #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS - "\t%8lu%%" + "\t%3lu%%" #endif "\t%4u\t%5lu" #if CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID From fbdba95735398647c546d5252e379e52212eec3f Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Thu, 24 Oct 2024 13:15:35 +0300 Subject: [PATCH 4/7] fix(format): Fix print of runtime formatting --- cores/esp32/freertos_stats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp32/freertos_stats.cpp b/cores/esp32/freertos_stats.cpp index 60305e07333..9a46067c624 100644 --- a/cores/esp32/freertos_stats.cpp +++ b/cores/esp32/freertos_stats.cpp @@ -44,7 +44,7 @@ void printRunningTasks(Print & printer) { #endif printer.printf("Tasks: %u" #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS - ", Runtime: %us, Period: %uus" + ", Runtime: %lus, Period: %luus" #endif "\n", uxArraySize #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS From fbd1dba40b71900c9bf362cc8b2727881e81ce74 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Fri, 25 Oct 2024 12:20:47 +0300 Subject: [PATCH 5/7] fix(stats): Add license, usage note and C++ guards --- cores/esp32/freertos_stats.cpp | 18 ++++++++++++++++-- cores/esp32/freertos_stats.h | 24 ++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/cores/esp32/freertos_stats.cpp b/cores/esp32/freertos_stats.cpp index 9a46067c624..4c25f7b7778 100644 --- a/cores/esp32/freertos_stats.cpp +++ b/cores/esp32/freertos_stats.cpp @@ -1,7 +1,19 @@ +// Copyright 2024 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #include "freertos_stats.h" #include "sdkconfig.h" -//#undef CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID -//#undef CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS #if CONFIG_FREERTOS_USE_TRACE_FACILITY #include "freertos/FreeRTOS.h" @@ -97,5 +109,7 @@ void printRunningTasks(Print & printer) { vPortFree( pxTaskStatusArray ); printer.println(); } +#else + printer.println("FreeRTOS trace facility is not enabled."); #endif /* CONFIG_FREERTOS_USE_TRACE_FACILITY */ } diff --git a/cores/esp32/freertos_stats.h b/cores/esp32/freertos_stats.h index ad14843c77b..77d2e0d2d76 100644 --- a/cores/esp32/freertos_stats.h +++ b/cores/esp32/freertos_stats.h @@ -1,4 +1,28 @@ +// Copyright 2024 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #pragma once + +#ifdef __cplusplus + #include "Print.h" +/* + * Executing this function will cause interrupts and + * the scheduler to be blocked for some time. + * Please use only for debugging purposes. + */ void printRunningTasks(Print & printer); + +#endif From c2940527997cea4819c89c89f2deac4c7afbd95f Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Fri, 25 Oct 2024 12:48:59 +0300 Subject: [PATCH 6/7] fix(stats): Fix formatting and variable names --- cores/esp32/freertos_stats.cpp | 47 +++++++++++++++++----------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/cores/esp32/freertos_stats.cpp b/cores/esp32/freertos_stats.cpp index 4c25f7b7778..0a720673016 100644 --- a/cores/esp32/freertos_stats.cpp +++ b/cores/esp32/freertos_stats.cpp @@ -24,13 +24,14 @@ void printRunningTasks(Print & printer) { #if CONFIG_FREERTOS_USE_TRACE_FACILITY #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS -#define FREERTOS_TASK_NUMBER_MAX_NUM 256 - static UBaseType_t ulRunTimeCounters[FREERTOS_TASK_NUMBER_MAX_NUM]; +#define FREERTOS_TASK_NUMBER_MAX_NUM 256 // RunTime stats for how many Tasks to be stored + static configRUN_TIME_COUNTER_TYPE ulRunTimeCounters[FREERTOS_TASK_NUMBER_MAX_NUM]; static configRUN_TIME_COUNTER_TYPE ulLastRunTime = 0; + configRUN_TIME_COUNTER_TYPE ulCurrentRunTime = 0, ulTaskRunTime = 0; #endif + configRUN_TIME_COUNTER_TYPE ulTotalRunTime = 0; TaskStatus_t *pxTaskStatusArray = NULL; volatile UBaseType_t uxArraySize = 0, x = 0; - configRUN_TIME_COUNTER_TYPE ulTotalRunTime = 0, uiCurrentRunTime = 0, uiTaskRunTime = 0; const char * taskStates[] = { "Running", "Ready", @@ -42,16 +43,16 @@ void printRunningTasks(Print & printer) { // Take a snapshot of the number of tasks in case it changes while this function is executing. uxArraySize = uxTaskGetNumberOfTasks(); - //printer.printf("Running tasks: %u\n", uxArraySize); // Allocate a TaskStatus_t structure for each task. - pxTaskStatusArray = (TaskStatus_t*)pvPortMalloc( uxArraySize * sizeof( TaskStatus_t ) ); + pxTaskStatusArray = (TaskStatus_t*)pvPortMalloc(uxArraySize * sizeof(TaskStatus_t)); - if( pxTaskStatusArray != NULL ) { + if (pxTaskStatusArray != NULL) { // Generate raw status information about each task. - uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, &ulTotalRunTime ); + uxArraySize = uxTaskGetSystemState(pxTaskStatusArray, uxArraySize, &ulTotalRunTime); + #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS - uiCurrentRunTime = ulTotalRunTime - ulLastRunTime; + ulCurrentRunTime = ulTotalRunTime - ulLastRunTime; ulLastRunTime = ulTotalRunTime; #endif printer.printf("Tasks: %u" @@ -60,7 +61,7 @@ void printRunningTasks(Print & printer) { #endif "\n", uxArraySize #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS - , ulTotalRunTime / 1000000, uiCurrentRunTime + , ulTotalRunTime / 1000000, ulCurrentRunTime #endif ); printer.printf("Num\t Name" @@ -72,14 +73,14 @@ void printRunningTasks(Print & printer) { "\tCore" #endif "\tState\r\n"); - for( x = 0; x < uxArraySize; x++ ) { + for (x = 0; x < uxArraySize; x++) { #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS - if (pxTaskStatusArray[ x ].xTaskNumber < FREERTOS_TASK_NUMBER_MAX_NUM) { - uiTaskRunTime = (pxTaskStatusArray[ x ].ulRunTimeCounter - ulRunTimeCounters[pxTaskStatusArray[ x ].xTaskNumber]); - ulRunTimeCounters[pxTaskStatusArray[ x ].xTaskNumber] = pxTaskStatusArray[ x ].ulRunTimeCounter; - uiTaskRunTime = (uiTaskRunTime * 100) / uiCurrentRunTime; // in percentage + if (pxTaskStatusArray[x].xTaskNumber < FREERTOS_TASK_NUMBER_MAX_NUM) { + ulTaskRunTime = (pxTaskStatusArray[x].ulRunTimeCounter - ulRunTimeCounters[pxTaskStatusArray[x].xTaskNumber]); + ulRunTimeCounters[pxTaskStatusArray[x].xTaskNumber] = pxTaskStatusArray[x].ulRunTimeCounter; + ulTaskRunTime = (ulTaskRunTime * 100) / ulCurrentRunTime; // in percentage } else { - uiTaskRunTime = 0; + ulTaskRunTime = 0; } #endif printer.printf("%3u\t%16s" @@ -91,22 +92,22 @@ void printRunningTasks(Print & printer) { "\t%4c" #endif "\t%s\r\n", - pxTaskStatusArray[ x ].xTaskNumber, - pxTaskStatusArray[ x ].pcTaskName, + pxTaskStatusArray[x].xTaskNumber, + pxTaskStatusArray[x].pcTaskName, #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS - uiTaskRunTime, + ulTaskRunTime, #endif - pxTaskStatusArray[ x ].uxCurrentPriority, - pxTaskStatusArray[ x ].usStackHighWaterMark, + pxTaskStatusArray[x].uxCurrentPriority, + pxTaskStatusArray[x].usStackHighWaterMark, #if CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID - (pxTaskStatusArray[ x ].xCoreID == tskNO_AFFINITY)?'*':('0'+pxTaskStatusArray[ x ].xCoreID), + (pxTaskStatusArray[x].xCoreID == tskNO_AFFINITY)?'*':('0'+pxTaskStatusArray[x].xCoreID), #endif - taskStates[pxTaskStatusArray[ x ].eCurrentState] + taskStates[pxTaskStatusArray[x].eCurrentState] ); } // The array is no longer needed, free the memory it consumes. - vPortFree( pxTaskStatusArray ); + vPortFree(pxTaskStatusArray); printer.println(); } #else From 25d41368d31a84b9dc75f9b1d1f44f35eb502ec0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2024 09:52:07 +0000 Subject: [PATCH 7/7] ci(pre-commit): Apply automatic fixes --- cores/esp32/freertos_stats.cpp | 53 +++++++++++++++------------------- cores/esp32/freertos_stats.h | 2 +- 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/cores/esp32/freertos_stats.cpp b/cores/esp32/freertos_stats.cpp index 0a720673016..50a98bf502b 100644 --- a/cores/esp32/freertos_stats.cpp +++ b/cores/esp32/freertos_stats.cpp @@ -21,10 +21,10 @@ #include "freertos/portable.h" #endif /* CONFIG_FREERTOS_USE_TRACE_FACILITY */ -void printRunningTasks(Print & printer) { +void printRunningTasks(Print &printer) { #if CONFIG_FREERTOS_USE_TRACE_FACILITY #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS -#define FREERTOS_TASK_NUMBER_MAX_NUM 256 // RunTime stats for how many Tasks to be stored +#define FREERTOS_TASK_NUMBER_MAX_NUM 256 // RunTime stats for how many Tasks to be stored static configRUN_TIME_COUNTER_TYPE ulRunTimeCounters[FREERTOS_TASK_NUMBER_MAX_NUM]; static configRUN_TIME_COUNTER_TYPE ulLastRunTime = 0; configRUN_TIME_COUNTER_TYPE ulCurrentRunTime = 0, ulTaskRunTime = 0; @@ -32,20 +32,13 @@ void printRunningTasks(Print & printer) { configRUN_TIME_COUNTER_TYPE ulTotalRunTime = 0; TaskStatus_t *pxTaskStatusArray = NULL; volatile UBaseType_t uxArraySize = 0, x = 0; - const char * taskStates[] = { - "Running", - "Ready", - "Blocked", - "Suspended", - "Deleted", - "Invalid" - }; + const char *taskStates[] = {"Running", "Ready", "Blocked", "Suspended", "Deleted", "Invalid"}; // Take a snapshot of the number of tasks in case it changes while this function is executing. uxArraySize = uxTaskGetNumberOfTasks(); // Allocate a TaskStatus_t structure for each task. - pxTaskStatusArray = (TaskStatus_t*)pvPortMalloc(uxArraySize * sizeof(TaskStatus_t)); + pxTaskStatusArray = (TaskStatus_t *)pvPortMalloc(uxArraySize * sizeof(TaskStatus_t)); if (pxTaskStatusArray != NULL) { // Generate raw status information about each task. @@ -55,52 +48,54 @@ void printRunningTasks(Print & printer) { ulCurrentRunTime = ulTotalRunTime - ulLastRunTime; ulLastRunTime = ulTotalRunTime; #endif - printer.printf("Tasks: %u" + printer.printf( + "Tasks: %u" #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS ", Runtime: %lus, Period: %luus" #endif - "\n", uxArraySize + "\n", + uxArraySize #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS - , ulTotalRunTime / 1000000, ulCurrentRunTime + , + ulTotalRunTime / 1000000, ulCurrentRunTime #endif ); printer.printf("Num\t Name" #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS - "\tLoad" + "\tLoad" #endif - "\tPrio\t Free" + "\tPrio\t Free" #if CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID - "\tCore" + "\tCore" #endif - "\tState\r\n"); + "\tState\r\n"); for (x = 0; x < uxArraySize; x++) { #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS if (pxTaskStatusArray[x].xTaskNumber < FREERTOS_TASK_NUMBER_MAX_NUM) { ulTaskRunTime = (pxTaskStatusArray[x].ulRunTimeCounter - ulRunTimeCounters[pxTaskStatusArray[x].xTaskNumber]); ulRunTimeCounters[pxTaskStatusArray[x].xTaskNumber] = pxTaskStatusArray[x].ulRunTimeCounter; - ulTaskRunTime = (ulTaskRunTime * 100) / ulCurrentRunTime; // in percentage + ulTaskRunTime = (ulTaskRunTime * 100) / ulCurrentRunTime; // in percentage } else { ulTaskRunTime = 0; } #endif - printer.printf("%3u\t%16s" + printer.printf( + "%3u\t%16s" #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS - "\t%3lu%%" + "\t%3lu%%" #endif - "\t%4u\t%5lu" + "\t%4u\t%5lu" #if CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID - "\t%4c" + "\t%4c" #endif - "\t%s\r\n", - pxTaskStatusArray[x].xTaskNumber, - pxTaskStatusArray[x].pcTaskName, + "\t%s\r\n", + pxTaskStatusArray[x].xTaskNumber, pxTaskStatusArray[x].pcTaskName, #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS ulTaskRunTime, #endif - pxTaskStatusArray[x].uxCurrentPriority, - pxTaskStatusArray[x].usStackHighWaterMark, + pxTaskStatusArray[x].uxCurrentPriority, pxTaskStatusArray[x].usStackHighWaterMark, #if CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID - (pxTaskStatusArray[x].xCoreID == tskNO_AFFINITY)?'*':('0'+pxTaskStatusArray[x].xCoreID), + (pxTaskStatusArray[x].xCoreID == tskNO_AFFINITY) ? '*' : ('0' + pxTaskStatusArray[x].xCoreID), #endif taskStates[pxTaskStatusArray[x].eCurrentState] ); diff --git a/cores/esp32/freertos_stats.h b/cores/esp32/freertos_stats.h index 77d2e0d2d76..ea9e1a55a21 100644 --- a/cores/esp32/freertos_stats.h +++ b/cores/esp32/freertos_stats.h @@ -23,6 +23,6 @@ * the scheduler to be blocked for some time. * Please use only for debugging purposes. */ -void printRunningTasks(Print & printer); +void printRunningTasks(Print &printer); #endif