Main Content

startProfiler

Start profiling service on target computer

Since R2020b

Description

example

startProfiler(target_object,app_name) starts the profiler on the target computer. You can start the profiler before or after you load the real-time application on the target computer. Before you start the application, you must start the profiler.

The startProfiler function affects the value of the target_object property ProfilerStatus.

  • Ready status indicates that the target_object exists, no profiling data is available, and the startProfiler function has not been called.

  • StartRequested status indicates that the target_object exists, no profiling data is available, the startProfiler function has started the profiler, and the real-time application is not loaded.

  • Running status indicates that the target_object exists, profiling data is being collected, the startProfiler function has started the profiler, and the real-time application is loaded and running.

  • DataAvailable status indicates that the target_object exists, profiling data is available, and the real-time application and the profiler have stopped.

When the profiler starts and stops, there is an increase in task execution time (TET) that can cause a CPU overload condition. If using profiler causes CPU overload, you can increase the sample time in order to use the profiler.

Examples

collapse all

Build the real-time application slrt_ex_mds_and_tasks. Load the real-time application. Start the profiler. Start the application.

tg = slrealtime('TargetPC1');
slbuild('slrt_ex_mds_and_tasks');
load(tg,'slrt_ex_mds_and_tasks');
startProfiler(tg);

% start profiler before starting application

start(tg);

Build the real-time application slrt_ex_mds_and_tasks. Load the application. Check the profiler status from the target object property ProfilerStatus.

  1. tg = slrealtime('TargetPC1');
    slbuild('slrt_ex_mds_and_tasks');
    load(tg,'slrt_ex_mds_and_tasks');
    tg.ProfilerStatus
    ans =
    
        'Ready'
  2. Start the profiler, and then start the application.

    startProfiler(tg);
    
    % start profiler before starting application
    
    start(tg);
  3. After the application stops, check the profiler status.

    tg.ProfilerStatus
    ans =
    
        'DataAvailable'

Input Arguments

collapse all

Provides access to methods that manipulate the target computer properties.

Example: tg

Provides name of real-time application MLDATX file that you built from the model.

Example: 'slrt_ex_osc'

Version History

Introduced in R2020b