Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Linux Tools Project/GCov/User Guide"

(No need to specify Xavier as the assignee)
(Installation and Set-Up: fix #379047)
Line 10: Line 10:
 
Gprof plugin depends on binutils (such as addr2line, c++filt and nm). Gprof can be used on any platform as soon as these binutils are in PATH. For example, you can use it on Windows with Cygwin.
 
Gprof plugin depends on binutils (such as addr2line, c++filt and nm). Gprof can be used on any platform as soon as these binutils are in PATH. For example, you can use it on Windows with Cygwin.
  
First of all, the user has to compile the C/C++ program with profiling enabled using "-ftest-coverage -fprofile-arcs" options prior to running the tool.
+
First of all, the user has to compile the C/C++ program with profiling enabled using "-ftest-coverage -fprofile-arcs" options prior to running the tool. These two options must be passed to both the compiler and the linker (please refer to gcc documentation for further information)
  
 
= Opening gcov result =
 
= Opening gcov result =

Revision as of 04:15, 10 May 2012

{{#eclipseproject:technology.linux-distros}}

Linux Tools
Website
Download
Community
Mailing ListForumsIRCmattermost
Issues
OpenHelp WantedBug Day
Contribute
Browse Source

Overview

The Gcov plugin allows to visualize in eclipse gcov's output (aka *.gcda/*.gcno files).

For more details on gcov, visit the GNU Gprof documentation at http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Gcov.html .

Installation and Set-Up

Gprof plugin depends on binutils (such as addr2line, c++filt and nm). Gprof can be used on any platform as soon as these binutils are in PATH. For example, you can use it on Windows with Cygwin.

First of all, the user has to compile the C/C++ program with profiling enabled using "-ftest-coverage -fprofile-arcs" options prior to running the tool. These two options must be passed to both the compiler and the linker (please refer to gcc documentation for further information)

Opening gcov result

Once the application is compiled and run is finished, several "gcno" and "gcda" files are generated under the project.


Gcov-project-explorer.png


Double clicking on one of these files will open a dialog to select the associated binary. Gcov-binary-file.png

Gcov main view

The Gcov view displays an overview of coverage information for the whole project.

GcovView.png


Several buttons are available in the toolbar.

  • Gprof-export-to-csv.gif : "Export to CSV" button allows you to export the gcov result as a CSV text file, suitable for any spreadsheet.
  • Gcov-sort-per-folder.gif : "Sort coverage per folder" button displays gcov result sorted by folder.
  • Gprof-sort-per-file.gif : "Sort coverage per file" button displays gcov result sorted by file.
  • Gprof-sort-per-function.gif : "Sort coverage per function" button displays gcov result sorted by function.
  • Gprof-birt-chart.gif : "Create Chart..." button allows you to create a BIRT chart, with the current lines selected in the gcov result view.


Double-clicking on a item in the result view will open the corresponding source location, annotated with coverage informations.

GcovAnnotatedSource.png

Troubleshooting

If you encounter a problem with gcov plugin, please file a bug.

Back to the top