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
diff options
context:
space:
mode:
authorHardy Griech <ntbox@gmx.net>2023-02-03 01:40:27 +0300
committerGitHub <noreply@github.com>2023-02-03 01:40:27 +0300
commit570ade4001e50adbf06a074582ea993af562e0e1 (patch)
treefa4ca4b39813a0034b2e2fd42daf8c7c5ee386f6
parent0f9e6e5b521009f585018b47f7e8aa573f010206 (diff)
performance counting: ulTaskSwitchedInTime and ulTotalRunTime must be (#618)
arrays, index is core number
-rw-r--r--tasks.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tasks.c b/tasks.c
index fa01cba94..cea4a2404 100644
--- a/tasks.c
+++ b/tasks.c
@@ -396,8 +396,8 @@ PRIVILEGED_DATA static volatile UBaseType_t uxSchedulerSuspended = ( UBaseType_t
/* Do not move these variables to function scope as doing so prevents the
* code working with debuggers that need to remove the static qualifier. */
- PRIVILEGED_DATA static uint32_t ulTaskSwitchedInTime = 0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */
- PRIVILEGED_DATA static volatile uint32_t ulTotalRunTime = 0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */
+ PRIVILEGED_DATA static uint32_t ulTaskSwitchedInTime[ configNUM_CORES ] = { 0UL }; /*< Holds the value of a timer/counter the last time a task was switched in. */
+ PRIVILEGED_DATA static volatile uint32_t ulTotalRunTime[ configNUM_CORES ] = { 0UL }; /*< Holds the total amount of execution time as defined by the run time counter clock. */
#endif
@@ -3877,9 +3877,9 @@ void vTaskSwitchContext( BaseType_t xCoreID )
#if ( configGENERATE_RUN_TIME_STATS == 1 )
{
#ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
- portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalRunTime );
+ portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalRunTime[ xCoreID ] );
#else
- ulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE();
+ ulTotalRunTime[ xCoreID ] = portGET_RUN_TIME_COUNTER_VALUE();
#endif
/* Add the amount of time the task has been running to the
@@ -3889,16 +3889,16 @@ void vTaskSwitchContext( BaseType_t xCoreID )
* overflows. The guard against negative values is to protect
* against suspect run time stat counter implementations - which
* are provided by the application, not the kernel. */
- if( ulTotalRunTime > ulTaskSwitchedInTime )
+ if( ulTotalRunTime[ xCoreID ] > ulTaskSwitchedInTime[ xCoreID ] )
{
- pxCurrentTCB->ulRunTimeCounter += ( ulTotalRunTime - ulTaskSwitchedInTime );
+ pxCurrentTCB->ulRunTimeCounter += ( ulTotalRunTime[ xCoreID ] - ulTaskSwitchedInTime[ xCoreID ] );
}
else
{
mtCOVERAGE_TEST_MARKER();
}
- ulTaskSwitchedInTime = ulTotalRunTime;
+ ulTaskSwitchedInTime[ xCoreID ] = ulTotalRunTime[ xCoreID ];
}
#endif /* configGENERATE_RUN_TIME_STATS */