Contenu principal

Code Profiling Using Existing Toolchain Setup

Calculate code coverage, execution time, or memory use of your C/C++ source files and xUnit tests

If you author C/C++ tests using the Polyspace Test xUnit API, you can profile your source files and tests to calculate code coverage, code execution time or memory use. To calculate these metrics, instrument your source code by using the polyspace-code-profiler command, build your tests together with the instrumented code, and execute the tests.

System Commands

polyspace-code-profiler(System Command) Profile your source code for calculating C/C++ code coverage, code execution time, and memory use

CMake Functions

pstest_add_profiling_runtime(CMake) Create target for compiling a custom run-time library for code profiling
pstest_instrument_target(CMake) Instrument a target for profiling
pstest_add_convert_target(CMake) Create target for converting test or code profiling results to standard Polyspace Test format
pstest_add_report_target(CMake) Generate XML and HTML reports from test or code profiling results

MATLAB Functions

pstest.exportToPolyspaceProfilingResults(MATLAB Function) Export coverage results from Simulink Coverage, Simulink Test, or MATLAB Test to Polyspace Test

Topics

Troubleshooting

Troubleshoot Code Profiling for Polyspace Test xUnit API-Based Tests

Troubleshoot calculating code coverage, execution profiling, and stack memory profiling of xUnit based tests.