Type of profiling
Profile one of code coverage, execution time, or memory use
Since R2023b
Description
Specify whether you want to calculate the code coverage metrics, the execution time, or the memory use. Based on your selection, Polyspace® Test™ instruments the source code.
Set Option
Set the option using one of these methods:
Polyspace Platform user interface (desktop products only): Select this option on the Profiling section of the Polyspace Platform toolstrip.
Command line: See Command-Line Information.
Why Use This Option
Profiling code coverage helps you determine whether your test cases cover the execution paths of your code adequately.
Profiling execution time helps you identify functions and other callable entities that introduce bottlenecks in your code.
Profiling memory use helps you identify functions or other callable entities that consume an unexpected amount of stack memory.
Use this option to specify your desired profiling option. You can select one of the three at a time.
Settings
No ProfilingDisables profiling.
Code CoverageEnables the calculation of code coverage metrics.
Execution TimeEnables the calculation of the execution time of the various functions and other callable entities in your code.
Memory UseEnables the calculation of the stack use of the various functions and other callable entities in your code.
Dependencies
At the command line, if you use -exec-metric-level or
-stack-metric-level, you must a provide a value as the input to
prof-counter-size.
Command-Line Information
At the command line you can select a type of profiling by using either the
polyspace-code-profiler command or the polyspace-test
command. If you have a *.psprjx project, use the
polyspace-test command. If you are profiling xUnit tests, use the
polyspace-code-profiler command.
polyspace-code-profiler
Parameter:
-cov-metric-level |
Value: none | statement | decision |
condition/decision | mcdc |
Example (code coverage): polyspace-code-profiler -instrument -instrum-dir |
Parameter:
-exec-metric-level |
Value: none | minimal | standard |
detailed |
Example (execution time):
polyspace-code-profiler -instrument -instrum-dir |
Parameter:
-stack-metric-level |
Value: none | minimal | standard |
detailed |
Example (memory use):
polyspace-code-profiler -instrument -instrum-dir |
polyspace-test
Parameter:
-profiling-mode |
Value: none | coverage | execution-profile
| stack-profile |
Example (code coverage):
polyspace-test -run -project |
Example (execution time):
polyspace-test -run -project |
Example (memory use):
polyspace-test -run -project |
Version History
Introduced in R2023b