mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
performance counting: ulTaskSwitchedInTime and ulTotalRunTime must be (#618)
arrays, index is core number
This commit is contained in:
parent
0f9e6e5b52
commit
570ade4001
14
tasks.c
14
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
|
/* Do not move these variables to function scope as doing so prevents the
|
||||||
* code working with debuggers that need to remove the static qualifier. */
|
* 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 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 = 0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */
|
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
|
#endif
|
||||||
|
|
||||||
|
@ -3877,9 +3877,9 @@ void vTaskSwitchContext( BaseType_t xCoreID )
|
||||||
#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
||||||
{
|
{
|
||||||
#ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
|
#ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
|
||||||
portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalRunTime );
|
portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalRunTime[ xCoreID ] );
|
||||||
#else
|
#else
|
||||||
ulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE();
|
ulTotalRunTime[ xCoreID ] = portGET_RUN_TIME_COUNTER_VALUE();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Add the amount of time the task has been running to the
|
/* 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
|
* overflows. The guard against negative values is to protect
|
||||||
* against suspect run time stat counter implementations - which
|
* against suspect run time stat counter implementations - which
|
||||||
* are provided by the application, not the kernel. */
|
* 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
|
else
|
||||||
{
|
{
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
ulTaskSwitchedInTime = ulTotalRunTime;
|
ulTaskSwitchedInTime[ xCoreID ] = ulTotalRunTime[ xCoreID ];
|
||||||
}
|
}
|
||||||
#endif /* configGENERATE_RUN_TIME_STATS */
|
#endif /* configGENERATE_RUN_TIME_STATS */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue