Main Content

getProfilerData

Retrieve profile data object

Description

example

profiler_object = getProfilerData(target_object) downloads the profiler files from the target computer to the development computer and assigns the data to the profiler_object. It displays an execution profile plot and a code execution profiling report.

The Execution Profile plot shows the allocation of execution cycles across the four processors, indicated by the colored horizontal bars. The Code Execution Profiling Report lists the model sections. The numbers underneath the bars indicate the processor cores.

The Code Execution Profiling Report displays model execution profile results for each task.

  • To display the profile data for a section of the model, click the membrane button   next to the section.

  • To display the TET data for the section in the Simulation Data Inspector, click the Plot time series data button .

  • To view the section in Simulink® Editor, click the link next to the Expand Tree button .

  • To view the lines of generated code corresponding to the section, click the expand tree button , and then click the view source button .

example

profiler_object = getProfilerData(target_object); downloads the profiler files from the target computer to the development computer and assigns the data to profiler_object. To display the profiler results, call the plot and report functions with the profiler_object as the argument.

Examples

collapse all

This example starts the profiler, stops the profiler, and displays execution profile data. The real-time application slrt_ex_mds_and_tasks is already loaded.

tg = slrealtime('TargetPC1');
slbuild('slrt_ex_mds_and_tasks');
load(tg,'slrt_ex_mds_and_tasks');
startProfiler(tg);
start(tg);
stopProfiler(tg);
stop(tg);
profiler_object = getProfilerData(tg)
Processing data on target computer, please wait ...
Transferring data from target computer to host computer, please wait ...
Processing data on host computer, please wait ...
 
Code execution profiling data for model slrt_ex_mds_and_tasks.

View the code execution profiling report for the model.

View the execution profile diagram for the model.

Starts the profiler, stops the profiler, and retrieves results data. Calls report and plot on the results data. The real-time application slrt_ex_mds_and_tasks is already loaded.

tg = slrealtime('TargetPC1');
slbuild('slrt_ex_mds_and_tasks');
load(tg,'slrt_ex_mds_and_tasks');
startProfiler(tg);
start(tg);
stopProfiler(tg);
stop(tg);
profiler_object = getProfilerData(tg);
rocessing data on target computer, please wait ...
Transferring data from target computer to host computer, please wait ...
Processing data on host computer, please wait ...
 
Code execution profiling data for model slrt_ex_mds_and_tasks.
report(profiler_object);

View the code execution profiling report for the model.

plot(profiler_object);

View the execution profile diagram for the model.

Input Arguments

collapse all

Provides access to methods that manipulate the target computer properties.

Example: tg

Output Arguments

collapse all

MATLAB® variable that you can use to access the result of the profiler execution. You display the profiler data by calling the plot and report functions.

The structure has these fields:

  • TargetName — Name of target computer in target computer settings.

  • ModelInfo — Information about model on which profiler ran:

    • ModelName — Name of real-time application.

    • MATLABRelease — MATLAB release under which model was built.

You can access the data in the profiler_object variable. To access the profiler data, before running the profiler, open the Configuration Parameters dialog box. In the Real-Time tab, click Hardware Settings. Select the Code Generation > Verification > Workspace variable option and set the value to executionProfile. Select the Save options option and set the value to All data. After running the profiler, use the technique described for the Sections (Embedded Coder) function.

Introduced in R2020b