You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make the type used to hold run-time counter values configurable (#350)
* Introduce configRUN_TIME_COUNTER_TYPE which enables developers to define the type used to hold run time statistic counters. Defaults to uint32_t for backward compatibility. #define configRUN_TIME_COUNTER_TYPE to a type (for example, uint64_t) in FreeRTOSConfig.h to override the default.
Introduce ulTaskGetIdleRunTimePercent() to complement the pre-existing ulTaskGetIdleRunTimeCounter(). Whereas the pre-existing function returns the raw run time counter value, the new function returns the percentage of the entire run time consumed by the idle task. Note the amount of idle time is only a good measure of the slack time in a system if there are no other tasks executing at the idle priority, tickless
idle is not used, and configIDLE_SHOULD_YIELD is set to 0.
* Add ultaskgetidleruntimepercent to lexicon.txt.
* Update History file.
Add the MPU version of ulTaskGetIdleRunTimePercent().
* Update include/FreeRTOS.h to correct comment as per aggarg@ suggestion.
* Fix alignment in mpu_wrappers.h.
Commit changes to mpu_prototypes.h which were missed from the original commit.
Copy file name to clipboardExpand all lines: include/task.h
+20-11Lines changed: 20 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@
52
52
*
53
53
* The tskKERNEL_VERSION_MAJOR, tskKERNEL_VERSION_MINOR, tskKERNEL_VERSION_BUILD
54
54
* values will reflect the last released version number.
55
-
*/
55
+
*/
56
56
#definetskKERNEL_VERSION_NUMBER "V10.4.4+"
57
57
#definetskKERNEL_VERSION_MAJOR 10
58
58
#definetskKERNEL_VERSION_MINOR 4
@@ -159,7 +159,7 @@ typedef struct xTASK_STATUS
159
159
eTaskStateeCurrentState; /* The state in which the task existed when the structure was populated. */
160
160
UBaseType_tuxCurrentPriority; /* The priority at which the task was running (may be inherited) when the structure was populated. */
161
161
UBaseType_tuxBasePriority; /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */
162
-
uint32_tulRunTimeCounter;/* The total run time allocated to the task so far, as defined by the run time stats clock. See https://www.FreeRTOS.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */
162
+
configRUN_TIME_COUNTER_TYPEulRunTimeCounter; /* The total run time allocated to the task so far, as defined by the run time stats clock. See https://www.FreeRTOS.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */
163
163
StackType_t*pxStackBase; /* Points to the lowest address of the task's stack area. */
164
164
configSTACK_DEPTH_TYPEusStackHighWaterMark; /* 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. */
/* Do not move these variables to function scope as doing so prevents the
401
401
* code working with debuggers that need to remove the static qualifier. */
402
-
PRIVILEGED_DATAstaticuint32_tulTaskSwitchedInTime=0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */
403
-
PRIVILEGED_DATAstaticvolatileuint32_tulTotalRunTime=0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */
402
+
PRIVILEGED_DATAstaticconfigRUN_TIME_COUNTER_TYPEulTaskSwitchedInTime=0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */
403
+
PRIVILEGED_DATAstaticvolatileconfigRUN_TIME_COUNTER_TYPEulTotalRunTime=0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */
0 commit comments