Intel® Inspector User Guide for Linux* OS

ID 767796
Date 5/15/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Working with Suppressions from the Command Line

Suppression files - files containing suppression rules - can be created and applied using the Intel Inspectorinspxe-cl command tool, or using Intel Inspector GUI tools. When analysis is performed on the command line, the ability to apply suppressions is automatically enabled regardless of project or result settings.

A suppression file is a collection of suppression rules for problems identified during analysis that you want excluded from future analysis results. For example, these problems could be in code that is not your responsibility, in third-party libraries, or false positives. When a suppression file is used during a subsequent analysis run, suppressed problems are ignored so that you can focus on unsuppressed and newly detected problems.

From the command line, you can create a suppress-all file to suppress all detected problems that remain in a specified result. When the code has changed and there are new problems that you want to suppress, you can create additional suppression files through the command line for these new unfixed problems. To create or delete individual suppression rules from a suppression file, you can use the Intel Inspector GUI tools. To edit suppression rules, you can use a text editor.

NOTE:

Suppression files can be used along with other problem-suppression tactics, such as assigning a problem the Not a Problem state, then filtering out all problems with this state when viewing problems in the GUI or generating a report on the command line. You can also propagate this state assignment forward into other results using one of the following techniques:

  • To merge problem state assignments from one existing result to another, use the merge-states option. State assignments from the merge-from result are used to update state assignments in the merge-to result. Problem states in the merge-to result are edited according to a set of rules.

  • To propagate problem state assignments forward when performing analysis, finalization or generating a report, use the baseline-result option.

Limitations of Suppression Rules

Intel Inspector suppression rules generally remain effective for edited source code, but when lines of code are changed within a function where a problem is marked, the problem may not be recognized the next time the suppression file is used.

This is because Intel Inspector identifies a problem based on source code lines relative to the start of a function, rather than absolute line number values. This makes it easier to track problems marked for suppression as lines of code are inserted and deleted in source files. However, adding or deleting lines within a function, prior to the location of a suppressed problem, can cause a problem to no longer match the suppression rule. In these cases, the problem is designated as a new problem in the subsequent analysis. If Inspector did not do this, suppressions would fail any time a line of code is added or removed.

Tips for Working with Suppression Files

  • Suppression rules are based on results for a particular analysis type, so the same general category of analysis must be used to generate a suppression file and when using it in subsequent analysis runs. For example, you would use one set of suppression files for threading error analysis, and a different set for memory error analysis.

  • Put all suppression files created for a specific type of analysis in a single, standard suppressions directory. This allows you to apply all the suppression files in this directory simply by specifying the directory path. To make it easy to switch between the GUI and the command line, store suppression files in the standard suppressions directory: ./My Inspector Results-[project name]/suppressions.

  • If your suppression files are not in a single directory, option files provide an easy way to pass in a series of suppression file paths to a -collect or -collect-with action.

  • You may use the same suppression file for multiple analysis runs, and may create and apply additional suppression files as needed.

  • Each suppression rule has some overhead associated with it, so it can be worthwhile to edit the suppression file and combine multiple related rules.

  • Conversion of third-party suppression files can only be performed through the command line.

  • Suppressions can also be applied when generating a report.