Quantcast
Channel: Intel Developer Zone Articles
Viewing all articles
Browse latest Browse all 3384

Transitioning from Valgrind* Tools to Intel® Inspector XE

$
0
0

The open source Valgrind* framework supports several tools for checking the memory and threading correctness of your code. Intel® Inspector XE has that same functionality but supports additional operating systems (Linux* and Microsoft Windows*), languages (C, C++, Microsoft .NET*, Fortran), and threading libraries (OpenMP*, Intel® Threading Building Blocks) while also providing a substantially more powerful GUI. This additional functionality makes it well worth buying a commercial tool.

Valgrind* Tools versus Intel Inspector XE

Memory Checking with memcheck

Memcheck is the most familiar Valgrind* tool. This tool uses binary instrumentation to do dynamic memory checking, as does the Intel Inspector XE. The two tools do many of the same things:

Intel Inspector XE, however, supports on-demand memory leak detection and memory growth detection. This provides real-time access to information about memory changes. On-demand memory analysis allows better tracking of memory in specific sections of the code, or on applications like daemons or system processes that do not have a natural termination. There is a Valgrind* option that enables this (-massif), but it carries a much heavier performance cost, as it is enabled for the entire program instead of for user-selected ranges.

Thread Checking with helgrind or DRD

There are two Valgrind* tools available if you are interested in threading errors: helgrind and DRD. These tools also use binary instrumentation to do dynamic thread checking, as does the Intel Inspector XE. Let’s take a look at what kind of errors the three tools find:

Intel Inspector XE helps you find the issues that these tools can find, as well as helps you if you have issues with cross-thread stack accesses.

Interactive GUI

The Valgrind* framework has its own GUI in a tool called Valkyrie, that works with all of the above tools. This is a very simple GUI that displays information about errors found and source information in a very basic way:

Compare this to the standalone Intel Inspector XE GUI available on both Windows* and Linux* and you will see there are collection logs, timeline information, and full featured filtering in addition to information about the error in question:

Intel Inspector XE also fully integrates into the Microsoft Visual Studio* IDE on the Windows* OS.

Team Development Features

Intel Inspector XE also has several features that make it suitable for working with large teams. You can archive results using the Export feature that lets you move results to a central loction for use by multiple engineers looking into correctness issues. Suppression files can be shared across individuals or teams. 

One particularly useful feature for teams is the State information. The Intel Inspector XE results contain state information. Errors that did not appear previously are set as New, errors from previous runs have their states propagated forward.This allows individual engineers to set the state about issues in their area. The tool allows all of those state changes to be merged together, and then on the next run the Intel Inspector XE will bring forward all of this state information (and if a diagnostic was set to “fixed” and it still reoccurs, it will alert the team to a regression in their correctness). This allows a process of steady improvement.

Transitioning from Valgrind* Tools to Intel Inspector XE

The transition from a Valgrind* tool to the Intel Inspector XE is straightforward. You can buy the Intel Inspector XE or download a 30-day evaluation version from https://software.intel.com/en-us/intel-inspector-xe . In that same location you can also find videos that give a good overview of the tool, access to a full version of online help, and many articles that give insight into how to get the most out of your tool. This is also where you go to locate our user forums, which are monitored by both Intel personnel and our community of devoted users. The forums, and product support, should be able to answer any question you may have in a timely fashion.

So now that you have the tool installed, what next? Intel Inspector XE uses binary instrumentation (like Valgrind* tools), which means that you do not need to recompile your sources. So you are mostly ready to go.

Converting Suppression Files

But if you have been using Valgrind* for a long time, you most likely have a set of suppression files that you have been working with. So the first thing you should do is take advantage of our script to translate those suppressions into the Intel Inspector suppression format.

To do that, use the command line tool, inspxe-cl in the bin32 directory of your Intel Inspector XE installation:

inspxe-cl -convert-suppression-file -from=known_problems.pft -to=known_problems.sup

After you run this once, you never need to run it again. The suppression format is published in the documentation and completely editable, or you can take advantage of the GUI-based suppression editor to add to your suppressions as needed.

Preparing Your Project Files

At this point you can just run from the command line (use inspxe-cl –help or see product documentation for more information) or, if you have a complex setup, use project properties to help you get the exact command line you are looking for.

Choose Project Properties from the File menu to set up information about the source, symbol information, and the name/parameters of the application:

Next, use the Configure Analysis Type pane to specify the type of analysis you want to do and select/deselect options. Next, either click Start to run the analysis in the GUI, or take advantage of the Command Line button in the lower right corner to get the exact command you need to run this analysis from the command line.

Conclusion

Intel Inspector XE provides access to the powerful memory and thread correctness information that you are used to finding with the Valgrind* tools, but also provides support for more operating systems, more languages, and more threading libraries. Our team support allows you to take the same result and use it across a large project or a widespread team without losing information. 


Viewing all articles
Browse latest Browse all 3384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>