Main Content

Resolve Code Profiling Errors When Profiling Is Disabled

Issue

Using Polyspace® Test™, you can calculate various C/C++ code profiling metrics such as code coverage, execution time, memory use, and other metrics. To calculate one of these metrics in the Polyspace Platform user interface, you select the appropriate metric instead of No Profiling on the toolstrip and then build your project.

In some cases, even with No Profiling selected on the toolstrip, you might see a message related to polyspace-code-profiler such as:

polyspace-code-profiler -instrument: The build command failed.
The issue occurs if you enable certain features that involve source code instrumentation under the hood.

Possible Solutions

Check if you have enabled one of these features that involve source code instrumentation and therefore invoke polyspace-code-profiler -instrument.

Check If Project Build Involves Building Mocks

Check if you have applied mocks to any of the function callees in the tests. Mocking involves instrumenting the source code for replacement of certain function calls with calls to their mock equivalents.

Check for Portable Word Size

Check if you are using the option Enable portable word sizes. Changing word size is implemented by instrumenting certain lines in the source code.

See Also