| Embedded IDE Link™ VS | ![]() |
profile(vd,'execution','report')
profile(vd,'stack',action)
profile(vd,'execution','report') returns execution profile measurements from the generated code. The report input argument is required. When you select the Profile real-time execution option in the configuration parameters for your model, and then build and run your model on a processor, this function accesses the report of the process execution.
Note Real-time task execution profiling works with hardware only. Simulators do not support the profiling feature. |
To use profile to assess how your program executes in real-time, complete the following tasks with a Simulink model:
Enable real-time execution profiling in the configuration parameters and build your model.
Select whether to profile by task or subsystem.
Build your model.
Download your program to the processor.
Run the program on the processor.
Stop the running program.
Use profile at the MATLAB command prompt to access the profiling reports.
The HTML report contains the sections described in the following table.
| Section Heading | Description |
|---|---|
| Worst case task turnaround times | Maximum task turnaround time for each task since model execution started. |
| Maximum number of concurrent overruns for each task | Maximum number of concurrent task overruns since model execution started. |
| Analysis of profiling data recorded over nnn seconds. | Profiling data was recorded over nnn seconds. The recorded data for task turnaround times and task execution times is presented in the table below this heading. |
Task turnaround time is the elapsed time between starting and finishing the task. If the task is not preempted, task turnaround time equals the task execution time.
Task execution time is the time between task start and finish when the task is actually running. It does not include time during which the task may have been preempted by another task.
Note Task execution time cannot be measured directly. Task profiling infers the execution time from the task start and finish times, and the intervening periods during which the task was preempted by another task. |
The execution time calculations do not account for processor time consumed by the scheduler while switching tasks. In cases where preemption occurs, the reported task execution times overestimate the true task execution time.
Task overruns occur when a timer task does not complete before the same task is scheduled to run again. Depending on how you configure the real-time scheduler, a task overrun may be handled as a real-time failure. Alternatively, you might allow a small number of task overruns to accommodate cases where a task occasionally takes longer than normal to complete. If a task overrun occurs, and the same task is scheduled to run again before the first overrun has been cleared, concurrent task overruns are said to have occurred.
Here is a sample of the HTML profiling report—task execution profile report.
profile(vd,'stack',action) returns the CPU stack usage from your application. action defines the stack profiling operation and accepts one of the strings in the following table:
| action String | Description |
|---|---|
| setup | Initializes the CPU stack with a known pattern—0xA5 on all processors. |
| report | Returns the report of the stack usage from running your application. |
You cannot assign the stack profile report to an output variable. The MATLAB structure output from profiling the system stack has the elements described in the following table.
| Report Entry | Units | Description |
|---|---|---|
| System Stack | Minimum Addressable Unit (MAU) | Maximum number of MAUs used and the total MAUs allocated for the stack. |
| name | String for the stack name | Lists the name assigned to the stack. |
| startAddress | Decimal address and page | Lists the address of the stack start and the memory page. |
| endAddress | Decimal address and page | Lists the address of the end of the stack and the memory page. |
| stackSize | Addresses | Reports number of address locations, in MAUs, allocated for the stack. |
| growthDirection | Not applicable | Reports whether the stack grows from the lower address to the higher address (ascending) or from higher to lower (descending). |
To use profile to assess how your program uses the stack, complete the following tasks with a Simulink model or manually written code:
Build your model with real-time execution profiling enabled in the configuration parameters. Skip this step for custom code.
Download your program to the processor.
Run the program on the processor.
Stop the running program.
Use profile at the MATLAB command prompt to access the profiling reports.
You cannot assign the stack profile report to an output variable. For more information about using stack profiling, refer to System Stack Profiling.
![]() | open | read | ![]() |
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |