instrumentCode
Add instrumentation to generated code to perform execution time / memory usage profiling and analyze code coverage
Since R2023a
Description
instrumentCode(
generates a SIL or
PIL MEX function for the code generation files located in buildFolder
)buildFolder
that you already produced by using the codegen
command. The generated MEX does not contain any additional
instrumentation.
instrumentCode(___,
enables you to include additional instrumentation in the SIL or PIL MEX that you generate
using the previous syntax. Provide one or more name-value arguments to specify the
instrumentation that you intend to include in the generated MEX. You can add instrumentation
to track stack memory usage, analyze C/C++ code coverage, profile entry-point functions, or
profile functions called within entry-point functions. You can also use
Name=Value
)instrumentCode
to specify the toolchain to use to build the generated
code, and compiler optimization and debug settings for the specified toolchain.
The instrumentCode
function decouples the code generation and code
instrumentation steps. This functionality enables you to analyze the execution behavior of
the code you intend to deploy without altering the original functional code. Once you
generate the code, you can apply the instrumentation as many times as you need.
Examples
Input Arguments
Name-Value Arguments
Version History
Introduced in R2023a