| Contents | Index |
IDE_Obj.profile(type,action,timeout)
This function supports the following IDEs:
Analog Devices VisualDSP++
Eclipse IDE
Green Hills MULTI
Texas Instruments Code Composer Studio v3
Use IDE_Obj.profile(type,action,timeout) to generate real-time execution or stack profiling report.
Create the IDE_Obj IDE handle object using a constructor function before you use the profile method.
The type argument determines the type of profile to generate. The following types are available for the IDEs specified.
| CCS IDE | Eclipse IDE | MULTI IDE | VisualDSP++ IDE | |
|---|---|---|---|---|
| 'execution' — Execution profiling | Yes | Yes, with limitations. | Yes | Yes |
| 'stack'— Stack profiling | Yes | Yes |
Currently, with the Eclipse IDE, you can only perform execution profiling for ARM processors running Linux.
To get a real-time task execution profile report in HTML and graphical plot forms, set the type argument to 'execution' and omit the action argument, which defaults to 'report'. For more information, see Execution Profiling for Embedded Targets.
To prepare the stack memory on the processor for profiling, set the type argument to 'stack', and set the action argument to 'setup'. This action writes a repetitive series of known values to the stack memory. For more information, see Stack Profiling for Embedded Targets.
After preparing the stack memory, to measure and report the percentage of stack usage, set the type argument to 'stack', and set the action argument to 'report'.
If you omit the action argument, action defaults to 'report'.
The optional timeout argument determines the number of seconds MATLAB waits for the IDE to finish profiling before returning an error. If you omit the timeout argument, the open method uses the timeout property of the IDE handle object (IDE_Obj) instead.
Note You can use real-time task execution profiling 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:
In a model that has a Target Preferences block, open the model configuration parameters (Ctrl+ E).
Select the IDE Link pane.
Enable Profile real-time execution.
Build your model.
IDE_Obj.build
Load your program to the processor.
IDE_Obj.load('c:\work\sumdiff.out')For stack profiling, initialize the stack to a known state. (For execution profiling, skip this step.)
IDE_Obj.profile('stack','setup')With the setup input argument, profile writes a known pattern into the addresses that compose the stack. For C6000 processors, the pattern is A5. For C2000™ and C5000 processors, the pattern is A5A5 to account for the address size. As long as your application does not write the same pattern to the system stack, profile can report the stack usage correctly.
Run the program on the processor.
IDE_Obj.run
Stop the running program.
IDE_Obj.halt
To get the profiling reports enter one of the following commands:
IDE_Obj.profile('stack','report') #Get stack profiling report
IDE_Obj.profile('execution') #Get execution profiling reportThe 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 following 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.

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |