Main Content

getProfilerData

Retrieve profile data object

Since R2020b

Description

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

The Execution Profiler and the SLRT Overload Options block use different mechanisms to measure TET and do not generate identical TET values.

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 .

The maximum log file size for the profiler data is 1024 MB.

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.

example

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.

  1. tg = slrealtime;
    mdlSTF = getSTFName(tg);
    mdlName = 'slrt_ex_osc_outport';
    openExample(mdlName);
    set_param(mdlName,"SystemTargetFile",mdlSTF);
    slbuild(mdlName);
    load(tg,mdlName);
    startProfiler(tg);
    start(tg);
  2. stopProfiler(tg);
    stop(tg);
  3. 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.

    The code execution profiling report for the model profiles execution of each section of code.

    The Simulation Data Inspector provides an 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.

  1. tg = slrealtime;
    mdlSTF = getSTFName(tg);
    mdlName = 'slrt_ex_mds_and_tasks';
    openExample(mdlName);
    set_param(mdlName,"SystemTargetFile",mdlSTF);
    slbuild(mdlName);
    load(tg,mdlName);
    startProfiler(tg);
    start(tg);
  2. stopProfiler(tg);
    stop(tg);
  3. 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.
  4. report(profiler_object);

    The code execution profiling report for the model profiles execution of each section of code.

  5. plot(profiler_object);

    The Simulation Data Inspector provides an 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 Speedgoat 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.

Version History

Introduced in R2020b