Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Linux Distributions Project - Valgrind

Revision as of 18:15, 9 December 2008 by Ebaron.redhat.com (Talk | contribs) (Try It)

Overview

Launch Configuration Dialog

The Linux Distributions Project Valgrind plugin aims to provide simple and effective profiling for the C/C++ Development Tools. There is a lot of Valgrind functionality to expose in Eclipse. Valgrind itself is very component based, this relates well to Eclipse plugins. The main architectural goal is to have a common Valgrind user interface and underlying launch framework, while the Valgrind tools themselves are contributed via extension points.

Extensibility

  • Each tool has the ability to contribute its own set of options to the Launch Configuration Dialog via the valgrindTools extension point and providing an implementation of the IValgrindToolPage interface. The controls created inside of the implementing class are nested into a tool specific tab in the Dialog.
  • An extender must also implement the IValgrindLaunchDelegate interface. This will control the lifecycle of the contributed tool and will receive control to parse the output of the underlying Valgrind process once the main delegate is finished.
  • There is a single Valgrind View, which by itself contains no output. Each tool provides its own appropriate way of displaying its output and, similar to the Launch Configuration Dialog, can embed its contributed controls into the View. This is done via the valgrindToolViews extension point and implementing the IValgrindToolView interface.

Memcheck

Memcheck

Memcheck is a tool that detects memory management problems. It is Valgrind's most popular tool and seemingly the most mature. It supports XML output with the specific purpose of being parsed by GUI front-ends. Memcheck's output is rather straight forward - it is a series of errors along with stack trace information.

Features

  • The Valgrind View presents this output using a TreeViewer with the errors as top-level elements.
  • The stack trace is presented underneath the error and when a frame is double-clicked an editor will open and go to the line in question.
  • Markers represent memcheck errors inside the editor and are linked to the Problems View.

Massif

Massif

Massif is a heap profiling tool. It takes several "snapshots" during execution of your program detailing the various heap allocations throughout. It's output for each snapshot primarily consists the time of the snapshot, how much was allocated that can be used, and how much extra was allocated than was asked. The unit of time can be configured to be instructions, milliseconds or bytes. At specified intervals, "detailed" snapshots are produced. These detailed snapshots contain a tree of heap allocations that comprise that snapshot. Unlike Memcheck, Massif does not yet support XML output.

Features

  • Massif's output is complex and as such requires creative ways of displaying it. Valgrind includes the ms_print program that is used to display Massif's output in a visually appealing manner. ms_print was used as a template for how to display this output.
  • The default view of the output is with a TableViewer. Snapshots are displayed as tabular data, just as ms_print does.
  • For detailed snapshots, an icon indicates the snapshot can be double-clicked and the View will display a TreeViewer of the detailed snapshots' heap allocation trees.
  • ms_print also provides a bar chart of bytes allocated throughout execution. In perhaps a more appropriate style, there is an option to display a line chart of this data.

TODO

  • Vastly improve chart representation, BIRT may be a better option than GEF in terms of chart building.

Try It

Back to the top