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

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

(No need to specify Xavier as the assignee)
(fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=333980)
Line 1: Line 1:
{{#eclipseproject:technology.linux-distros}}
+
{{#eclipseproject:technology.linux-distros}} {{Linux_Tools}}  
{{Linux_Tools}}
+
= Overview =
+
The Gprof plugin allows to visualize in eclipse gprof's output (aka gmon.out).
+
  
For more details on gprof, visit the GNU Gprof documentation at http://sourceware.org/binutils/docs-2.20/gprof/index.html .
+
= Overview  =
  
= Installation and Set-Up =
+
The Gprof plugin allows to visualize in eclipse gprof's output (aka gmon.out).
  
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.
+
For more details on gprof, visit the GNU Gprof documentation at http://sourceware.org/binutils/docs-2.20/gprof/index.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 the -pg option prior to running the tool.  
 
First of all, the user has to compile the C/C++ program with profiling enabled using the -pg option prior to running the tool.  
  
[[Image:Gprof-compile-step.png]]
+
[[Image:Gprof-compile-step.png]]  
 +
 
 +
= Supported format  =
 +
 
 +
Up to now, the Gprof plugin supports gmon files generated on:
  
= Opening gmon.out =
+
*linux (ELF) 32 bits<br>
 +
*linux (ELF) 64 bits
 +
*cygwin and BSD: support is not yet complete. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=333984
 +
*powerpc: ongoing. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=351355
  
Once the application run is finished, a gmon.out file is generated under the project.
+
= Opening gmon.out =
  
[[Image:Gprof-project-explorer.png]]
+
Once the application run is finished, a gmon.out file is generated under the project.  
  
 +
[[Image:Gprof-project-explorer.png]]
  
Double clicking on this file will open a dialog to select the associated binary.  
+
<br> Double clicking on this file will open a dialog to select the associated binary.  
  
[[Image:Gprof-binary-file.png]]
+
[[Image:Gprof-binary-file.png]]  
  
 
= GProf View  =
 
= GProf View  =
  
The Gprof view shows which parts of the program consume most of the execution time. It also provides call graph infomation for each function.
+
The Gprof view shows which parts of the program consume most of the execution time. It also provides call graph infomation for each function.  
  
 
<br> [[Image:Gprof-view.jpg]]  
 
<br> [[Image:Gprof-view.jpg]]  
Line 33: Line 42:
 
<br> Several buttons are available in the toolbar.  
 
<br> Several buttons are available in the toolbar.  
  
* [[Image:Gprof-export-to-csv.gif]] : "Export to CSV" button allows you to export the gprof result as a CSV text file, suitable for any spreadsheet.
+
*[[Image:Gprof-export-to-csv.gif]]&nbsp;: "Export to CSV" button allows you to export the gprof result as a CSV text file, suitable for any spreadsheet.  
* [[Image:Gprof-sort-per-file.gif]] : "Sort samples per file" button displays gprof result sorted by file.
+
*[[Image:Gprof-sort-per-file.gif]]&nbsp;: "Sort samples per file" button displays gprof result sorted by file.  
* [[Image:Gprof-sort-per-function.gif]] : "Sort samples per function" button displays gprof result sorted by function.
+
*[[Image:Gprof-sort-per-function.gif]]&nbsp;: "Sort samples per function" button displays gprof result sorted by function.  
* [[Image:Gprof-sort-per-line.gif]] : "Sort samples per line" button displays gprof result sorted by line.  
+
*[[Image:Gprof-sort-per-line.gif]]&nbsp;: "Sort samples per line" button displays gprof result sorted by line.  
* [[Image:Gprof-display-call-graph.png]] : "Display function call graph" button displays gprof result as a call graph.  
+
*[[Image:Gprof-display-call-graph.png]]&nbsp;: "Display function call graph" button displays gprof result as a call graph.
  
* [[Image:Gprof-sample-time.gif]] : "Switch samples/time" button allows you to switch result display from samples to time and vice-versa.
+
*[[Image:Gprof-sample-time.gif]]&nbsp;: "Switch samples/time" button allows you to switch result display from samples to time and vice-versa.  
* [[Image:Gprof-birt-chart.gif]] : "Create Chart..." button allows you to create a BIRT chart, with the current lines selected in the gprof result view.
+
*[[Image:Gprof-birt-chart.gif]]&nbsp;: "Create Chart..." button allows you to create a BIRT chart, with the current lines selected in the gprof result view.
  
 +
<br>
  
 +
If program is compiled with debug option (e.g. "-g"), double-clicking on a item in the result will open the corresponding source location.
  
If program is compiled with debug option (e.g. "-g"), double-clicking on a item in the result will open the corresponding source location.
+
= Troubleshooting  =
  
= Troubleshooting =
 
 
If you encounter a problem with the gprof plugin, please [https://bugs.eclipse.org/bugs/enter_bug.cgi?bug_severity=normal&bug_status=NEW&comment=&component=GProf&contenttypeentry=&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&data=&dependson=&description=&flag_type-1=X&flag_type-2=X&flag_type-4=X&flag_type-6=X&flag_type-7=X&flag_type-8=X&form_name=enter_bug&keywords=&op_sys=Linux&priority=P3&product=Linux%20Tools&qa_contact=&rep_platform=PC&short_desc= file a bug].
 
If you encounter a problem with the gprof plugin, please [https://bugs.eclipse.org/bugs/enter_bug.cgi?bug_severity=normal&bug_status=NEW&comment=&component=GProf&contenttypeentry=&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&data=&dependson=&description=&flag_type-1=X&flag_type-2=X&flag_type-4=X&flag_type-6=X&flag_type-7=X&flag_type-8=X&form_name=enter_bug&keywords=&op_sys=Linux&priority=P3&product=Linux%20Tools&qa_contact=&rep_platform=PC&short_desc= file a bug].

Revision as of 11:04, 19 October 2011

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

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

Overview

The Gprof plugin allows to visualize in eclipse gprof's output (aka gmon.out).

For more details on gprof, visit the GNU Gprof documentation at http://sourceware.org/binutils/docs-2.20/gprof/index.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 the -pg option prior to running the tool.

Gprof-compile-step.png

Supported format

Up to now, the Gprof plugin supports gmon files generated on:

Opening gmon.out

Once the application run is finished, a gmon.out file is generated under the project.

Gprof-project-explorer.png


Double clicking on this file will open a dialog to select the associated binary.

Gprof-binary-file.png

GProf View

The Gprof view shows which parts of the program consume most of the execution time. It also provides call graph infomation for each function.


Gprof-view.jpg


Several buttons are available in the toolbar.

  • Gprof-export-to-csv.gif : "Export to CSV" button allows you to export the gprof result as a CSV text file, suitable for any spreadsheet.
  • Gprof-sort-per-file.gif : "Sort samples per file" button displays gprof result sorted by file.
  • Gprof-sort-per-function.gif : "Sort samples per function" button displays gprof result sorted by function.
  • Gprof-sort-per-line.gif : "Sort samples per line" button displays gprof result sorted by line.
  • Gprof-display-call-graph.png : "Display function call graph" button displays gprof result as a call graph.
  • Gprof-sample-time.gif : "Switch samples/time" button allows you to switch result display from samples to time and vice-versa.
  • Gprof-birt-chart.gif : "Create Chart..." button allows you to create a BIRT chart, with the current lines selected in the gprof result view.


If program is compiled with debug option (e.g. "-g"), double-clicking on a item in the result will open the corresponding source location.

Troubleshooting

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

Back to the top