coder.profile.test.analyzePath - Identify critical paths of tasks - MATLAB (original) (raw)

Identify critical paths of tasks

Since R2024a

Syntax

Description

[resultsObject](#mw%5F1351d2b0-48ad-43db-bbbf-3fe5be2b42ae) = coder.profile.test.analyzePath([modelName](#mw%5Fe8393dbb-8415-4668-b036-c545c49bdd1a), SimMode="SIL") collects execution-time metrics for tasks through a software-in-the-loop (SIL) or processor-in-the-loop (PIL) simulation using the model inputs. Then, it analyzes the metrics and identifies the code execution paths of the tasks that take the longest measured execution times, which are the critical paths.

The function stores the results in the resultsObject object. The results include:

Use Code Profile Analyzer to analyze the results in resultsObject.

example

[resultsObject](#mw%5F1351d2b0-48ad-43db-bbbf-3fe5be2b42ae)= coder.profile.test.analyzePath([modelName](#mw%5Fe8393dbb-8415-4668-b036-c545c49bdd1a), TestFile="myTestFile") uses the model's SIL/PIL Mode and test cases in the SimulinkĀ® Testā„¢ file myTestFile for the analysis.

[resultsObject](#mw%5F1351d2b0-48ad-43db-bbbf-3fe5be2b42ae)= coder.profile.test.analyzePath(..., [Name=Value](#namevaluepairarguments)) specifies additional name-value arguments.

Examples

collapse all

You can use coder.profile.test.analyzePath and the Code Profile Analyzer to identify critical paths of the generated tasks and performance bottlenecks in them.

Input Arguments

collapse all

Name of the model, specified as a character vector or string.

Example: "myModel"

Name-Value Arguments

collapse all

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: resultsObject = coder.profile.test.analyzePath("myModel",SimMode="SIL")

Types of instrumentation approach for the analysis:

Example: resultsObject = coder.profile.test.analyzePath("myModel",InstrumentationMode="CoarseGrained", SimMode="SIL")

Data Types: char | string

TestFile specifies the path to the MLDATX test file. When you specify the path to the test file, thecoder.profile.test.analyzePath function uses the model'sSIL/PIL Mode and the test cases in the file for the analysis. If you want to specify the simulation mode, set a value forSimMode.

Example: resultsObject = coder.profile.test.analyzePath("myModel",TestFile="New Folder\taprj\sldv_output\mymodel\mymodel_test.mldatx")

Data Types: char | string

Simulation mode specified as SIL or PIL. If you want to use model inputs for the analysis, you must specify a simulation mode.

Example: resultsObject = coder.profile.test.analyzePath("myModel", SimMode="SIL")

Data Types: char | string

When you set Verbose to true, the function displays diagnostic messages after each step of the analysis in the MATLAB Command Window. If the function encounters errors, it generates a PDF file in your working directory providing information on the root cause of the errors.

Example: resultsObject = coder.profile.test.analyzePath("myModel",SimMode="SIL",Verbose=true)

Data Types: logical

Output Arguments

collapse all

This object stores the identified critical paths and estimated cost percentages of code sections in the identified paths.

Use Code Profile Analyzer to analyze the results. To get a cell array of model elements in the identified critical path, use the function.

Version History

Introduced in R2024a