Simulink Real-Time Performance Analyzer
R2026bVisualize task execution timeline and CPU utilization for real-time application running on target computer
Since R2026b
Description
The Simulink® Real-Time™ Performance Analyzer transforms raw scheduler trace data from Speedgoat® target computers into an execution-centric visualization. Use this tool to identify performance bottlenecks, analyze task durations, and visualize CPU utilization without requiring kernel-level expertise.
Use Simulink Real-Time Performance Analyzer for these tasks:
View the task execution timeline showing thread-level activity for Base Rate and subrate tasks.
View CPU utilization across cores and identify task distribution.
Diagnose scheduling issues such as pre-emptions, voluntary sleeps, CPU migrations, and time-slicing.
Inspect execution segments to view thread names, scheduler timestamps, and CPU core assignments.
Export the timeline visualization as a PNG image.
Visual Indicators
The Performance Analyzer uses color-coded outlines on timeline bars to diagnose scheduling behavior:
| Outline Color | Condition | Recommended Action |
|---|---|---|
| Red | Thread preempted | Check real-time priority assignments. |
| Amber | Interrupted sleep inside a cycle (for example, nanosleep()
pacing) | Normal for rate threads. Duration grows as model time increases. |
| Cyan | CPU migration mid-cycle | Check CPU affinity and cache pressure. |
Open the Simulink Real-Time Performance Analyzer App
From the MATLAB® Command Window, type:
slrtPerformanceAnalyzer('ftraceOutput.txt')You can also open the tool without specifying a file. In the Command Window, type:
slrtPerformanceAnalyzer
Then click Open File in the toolstrip to load a trace data file.
Before you open the tool, you must collect trace data from the target computer. To collect trace data:
Build and load the real-time application on the target computer.
slbuild(modelName); load(tg,modelName);
Start the tracer before you start the application.
startTracer(tg);
Start the real-time application.
start(tg);
Stop the tracer to save data on the target computer.
stopTracer(tg);
Retrieve the trace data from the target computer.
getTracerData(tg);
Examples
Parameters
Programmatic Use
Tips
You do not need to recompile the application to collect trace data. You can start tracing on an existing loaded application.
Click a bar in the Task Execution Timeline to view execution segment details, including the thread name, cycle state, raw
sched_switchtimestamps, and the CPU core number.The red outline on a timeline bar indicates the thread is preempted and cyan indicates that the thread is migrated.
Version History
Introduced in R2026b
