Code covered by the BSD License  

Highlights from
Task execution profiling kit for Real-Time Workshop targets

image thumbnail
from Task execution profiling kit for Real-Time Workshop targets by David Maclay
A set of tools and examples to implement task execution profiling for a Real-Time Workshop target

RTW Report - Execution Profile Results
RTW Report - Execution Profile Results Model Execution Profiling Results

All times are in seconds. The timer resolution is 2e-007 seconds and the measurement range is 0.013107 seconds.

Worst case task turnaround times

Maximum task turnaround time for each task since model execution started. The task turnaround time is continually updated from the time when model execution began; the value is only allowed to increase and therefore records the maximum task turnaround time which is the worst case.
Note that the maximum task turnaround time that can be measured is limited by the timer measurement range. This may affect the results, for example, if the timer word-size is only 8 or 16 bits and if the sub-rate sample times are much longer than the base sample time.

TaskMaximum turnaround time
Base-Rate0.000287
Sub-Rate 10.000219
Sub-Rate 20.000224


Maximum number of concurrent overruns for each task

Maximum number of concurrent task overruns since model execution started.

TaskMaximum number of task overruns
Base-Rate0
Sub-Rate 10
Sub-Rate 20



Analysis of profiling data recorded over 0.0075876 seconds.

Profiling data was recorded over 0.0075876 seconds. The recorded data for task turnaround times and task execution times is presented in the table below.

TaskMaximum turnaround timeAverage turnaround timeMaximum execution timeAverage execution timeAverage sample time
Base-Rate0.000281 at 0.003280.000280.000281 at 0.003280.000280.00079998
Sub-Rate 10.000219 at 0.002780.0002180.000202 at 0.001180.0002020.0015996
Sub-Rate 20.00019 at 0.003590.000190.00019 at 0.003590.00019Inf
Interrupt 31.68e-005 at 0.006221.66e-0051.68e-005 at 0.006221.66e-0050.0015504
Interrupt 41.62e-005 at 0.00281.62e-0051.62e-005 at 0.00281.62e-0050.0015997

Task turnaround time is the elapsed time between start and finish of the task. If the task is not pre-empted then the task turnaround time is equal to the task execution time.

Task execution time is that part of the time between task start and finish when the task is actually running and not pre-empted by another task. Note that the task execution time cannot be measured directly, but is inferred from the task start and finish time and the intervening periods during which it was preempted by another task. Note that, in performing these calculations, no account is taken of processor time consumed by the scheduler while switching tasks: this means that, in cases where preemption has occurred, the reported task execution times will overestimate the true values.

Task overruns occur when a timer task does not complete before that same task is next scheduled to run. Depending on how the real-time scheduler is configured, a task overrun may be handled as a real-time failure. Alternatively, a small number of task overruns may be allowed in order to accommodate cases where a task occasionally takes longer than normal to complete. If a task overrun has occurred and the same task is again scheduled to run before the first overrun has been cleared then two concurrent task overruns are said to have occurred.

Copyright 2006, The MathWorks, Inc

Contact us at files@mathworks.com