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.
This commit is contained in:
RichardBarry 2021-06-14 12:17:41 -07:00 committed by GitHub
parent 6a84f2c1da
commit ddc840fd28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 109 additions and 35 deletions

View file

@ -905,6 +905,13 @@
#define configSTACK_DEPTH_TYPE uint16_t
#endif
#ifndef configRUN_TIME_COUNTER_TYPE
/* Defaults to uint32_t for backward compatibility, but can be overridden in
* FreeRTOSConfig.h if uint32_t is too restrictive. */
#define configRUN_TIME_COUNTER_TYPE uint32_t
#endif
#ifndef configMESSAGE_BUFFER_LENGTH_TYPE
/* Defaults to size_t for backward compatibility, but can be overridden
@ -1197,7 +1204,7 @@ typedef struct xSTATIC_TCB
void * pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];
#endif
#if ( configGENERATE_RUN_TIME_STATS == 1 )
uint32_t ulDummy16;
configRUN_TIME_COUNTER_TYPE ulDummy16;
#endif
#if ( configUSE_NEWLIB_REENTRANT == 1 )
struct _reent xDummy17;