Main Content

startProfiler

Start profiling service on target computer

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.

Examples

collapse all

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

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

% start profiler before starting application

start(tg);

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

tg = slrealtime('TargetPC1');
slbuild(''slrt_ex_ExecutionProfAndConc');
load(tg,''slrt_ex_ExecutionProfAndConc');
tg.ProfilerStatus
ans =

    'Ready'

Start the profiler, and then start the application.

startProfiler(tg);

% start profiler before starting application

start(tg);

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'

Introduced in R2020b