General Statistics Run-Time

The following is a list of µC/OS-III variables that are not associated to any specific task.

Interrupts

OSIntNestingCtr

This variable contains the interrupt nesting level. 1 means servicing the first level of interrupt nesting, 2 means the interrupt was interrupted by another interrupt, etc.

OSIntDisTimeMax

This variable contains the maximum interrupt disable time (in CPU_TS units).

Number of Kernel Objects

OSFlagQty

This variable indicates the number of event flag groups created. This variable is declared only if OS_CFG_FLAG_EN is set to DEF_ENABLED in os_cfg.h.

OSMemQty

This variable indicates the number of fixed-sized memory partitions created by the application. This variable is declared only if OS_CFG_MEM_EN is set to DEF_ENABLED in os_cfg.h.

OSMutexQty

This variable indicates the number of mutual exclusion semaphores created by the application. This variable is declared only if OS_CFG_MUTEX_EN is set to DEF_ENABLED in os_cfg.h.

OSSemQty

This variable indicates the number of semaphores created by your application. This variable is declared only if OS_CFG_SEM_EN is set to DEF_ENABLED in os_cfg.h.

OSTaskQty

The variable contains the total number of tasks created in the application.

OSTmrQty

This variable indicates the number of timers created by the application. It is declared only if OS_CFG_TMR_EN is set to DEF_ENABLED in os_cfg.h.

Message Pool

OSMsgPool.NbrFree

The variable indicates the number of free OS_MSGs in the message pool. This number should never be zero since that indicate that the application is no longer able to send messages. This variable is declared only if OS_CFG_Q_EN is set to DEF_ENABLED, or OS_CFG_TASK_Q_EN is set to DEF_ENABLED in os_cfg.h.

OSMsgPool.NbrUsed

This variable indicates the number of OS_MSGs currently used by the application. This variable is declared only if OS_CFG_Q_EN is set to DEF_ENABLED, or OS_CFG_TASK_Q_EN is set to DEF_ENABLED in os_cfg.h.

OSMsgPool.NbrUsedMax

This variable indicates the maximum (i.e. peak) number of OS_MSGs that was ever used by the application and is reset by OSStatReset(). This variable is declared only if OS_CFG_Q_EN is set to DEF_ENABLED, or OS_CFG_TASK_Q_EN is set to DEF_ENABLED in os_cfg.h.

Ready List

OSRdyList[i].NbrEntries

These variable are used to examine how many entries there are in the ready list at each priority.  The variables are enabled when OS_CFG_DBG_EN is set to DEF_ENABLED in os_cfg.h.

Scheduler

OSSchedLockTimeMax

This variable indicates the maximum amount of time the scheduler was locked irrespective of which task did the locking. It represents the global scheduler lock time. This value is expressed in CPU_TS units. The variable is declared only if OS_CFG_SCHED_LOCK_TIME_MEAS_EN is set to DEF_ENABLED in os_cfg.h.

OSSchedLockTimeMaxCur

This variable indicates the maximum amount of time the scheduler was locked. This value is expressed in CPU_TS units and is reset by the context switch code so that it can track the scheduler lock time on a per-task basis. This variable is declared only if OS_CFG_SCHED_LOCK_TIME_MEAS_EN is set to DEF_ENABLED in os_cfg.h.

OSSchedLockNestingCtr

This variable keeps track of the nesting level of the scheduler lock.

OSSchedRoundRobinEn

When set to 1, this variable indicates that round robin scheduling is enabled.

Statistics Task

OSStatTaskCPUUsage

This variable indicates the CPU usage of the application expressed as a percentage multiplied by 100. A value of 1000 indicates that 10.00% of the CPU is used, while 90.00% of the time the CPU is idling. This variable is declared only if OS_CFG_STAT_TASK_EN is set to DEF_ENABLED in os_cfg.h.

OSStatTaskCPUUsageMax

This variable indicates the maximum CPU usage of the application expressed as a percentage multiplied by 100. A value of 1000 indicates that 10.00% of the CPU is used, while 90.00% of the time the CPU is idling. This variable is declared only if OS_CFG_STAT_TASK_EN is set to DEF_ENABLED in os_cfg.h. and can be reset by calling OSStatReset().

OSStatTaskCtr

This variable contains a counter that is incremented every time the idle task infinite loop runs. This variable is declared only if OS_CFG_STAT_TASK_EN is set to DEF_ENABLED in os_cfg.h.

OSStatTaskCtrMax

This variable contains the maximum number of times the idle task loop runs in 0.1 second. This value is used to measure the CPU usage of the application. This variable is declared only if OS_CFG_STAT_TASK_EN is set to DEF_ENABLED in os_cfg.h.

OSStatTaskTimeMax

This variable contains the maximum execution time of the statistic task (in CPU_TS units). It is declared only if OS_CFG_STAT_TASK_EN is set to DEF_ENABLED in os_cfg.h. The total time also includes the time of any ISR that occurred while the statistic task was running.

Tick Task

OSTickCtr

This variable is incremented every time the tick task executes.

OSTickTaskTimeMax

This variable contains the maximum execution time of the tick task (in CPU_TS units). The total time also includes the time of any ISR that occurred while the tick task was running.

OSTickListDly.NbrEntries

This variable indicates the number of tasks currently in the list of task that are waiting for time to expire. This number is updated whenever tasks are inserted or removed from that list. This field is only available when OS_CFG_DBG_EN is set to DEF_ENABLED in os_cfg.h.

OSTickListDly.NbrUpdated

This variable indicates the number of OS_TCBs, in the list of tasks waiting for time to expire, that were last updated by OS_TickTask(). In other words, if OS_TickTask() only updated the .TickRemain of one OS_TCB then this value would be set to 1. This field is only available when OS_CFG_DBG_EN is set to DEF_ENABLED in os_cfg.h.

OSTickListTimeout.NbrEntries

This variable indicates the number of tasks currently in the list of task that are pending on an object and have specified a non-zero timeout value. This number is updated whenever tasks are inserted or removed from that list. This field is only available when OS_CFG_DBG_EN is set to DEF_ENABLED in os_cfg.h.

OSTickListTimeout.NbrUpdated

This variable indicates the number of OS_TCBs, in the list of tasks pending on an object and have specified a non-zero timeout value, that were last updated by OS_TickTask(). In other words, if OS_TickTask() updated three OS_TCBs then this value would be set to 3. This field is only available when OS_CFG_DBG_EN is set to DEF_ENABLED in os_cfg.h.

Timer Task

OSTmrCtr

This variable is incremented every time the timer task executes.

OSTmrListEntries

This variable contains the number of timers currently in the timer list. It is declared only if OS_CFG_TMR_EN is set to DEF_ENABLED in os_cfg.h.

OSTmrTaskTimeMax

This variable contains the maximum execution time of the timer task (in CPU_TS units). It is declared only if OS_CFG_TMR_EN is set to DEF_ENABLED in os_cfg.h. The total time also includes the time of any ISR that occurred while the timer task was running.

Miscellaneous

OSIdleTaskCtr 

This variable contains a counter that is incremented every time the idle task infinite loop runs.

OSRunning 

When non-zero, this variable indicates that multitasking has started.

OSTaskCtxSwCtr 

This variable accumulates the number of context switches performed by μC/OS-III.