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

Linux Tools Project/Callgraph/User Guide

Overview

The Eclipse-Callgraph plug-in provides a visual function trace of a program. This allows you to view a visualization of selected (or even all) functions used by the profiled application.


This plug-in allows you to profile C/C++ projects directly within the Eclipse IDE, providing various runtime details such as:

  • The relationship between function calls
  • Number of times each function was called
  • Time taken by each instance of a function (relative to the program's execution time)
  • Time taken by all instances of a function (relative to program's execution time)


Eclipse-Callgraph uses SystemTap to perform function traces. For more information about SystemTap, refer to the SystemTap Beginner's Guide.

Installation

Performing visual function traces with Eclipse-Callgraph requires three components:

  • the Eclipse-Callgraph package
  • SystemTap
  • the kernel information packages required by SystemTap


You can install all of these items through yum. To install Eclipse-Callgraph and SystemTap, run:

yum install eclipse-callgraph systemtap systemtap-runtime -y


The required kernel information packages are the matching -devel, -debuginfo, and -debuginfo-common packages of the kernel you wish to profile. You can use yum or debuginfo-install to install these packages. For more details about installing SystemTap, refer to Installation and Setup from the SystemTap Beginner's Guide.

General Usage

All the profiling plugins (including Eclipse-Callgraph) are accessible from the C/C++ perspective. To start using Eclipse-Callgraph, right-click on a project then navigate to Profile As > Function callgraph.

Profile-screen.png


This will open a dialog from which you can select an executable to profile.

Eclipsecallgraph-profilewhich.png


After selecting an executable to profile, Eclipse-Callgraph will ask which files to probe. By default, all source files in the project will be selected.

Selectfilestoprobe.png


The Callgraph View

The Callgraph view's toolbar allows you to select a perspective and perform other functions. To play a visual representation of a function trace, click the View Menu button then navigate to Goto. This menu will allow you to pause, step through, or mark each function as it executes.

Eclipsecallgraph-play.png


You can also save or load a profile run through the View Menu. To do either, navigate to File (under the View Menu); this will display different options relating to saving and loading profile runs.

Radial View

The Radial View displays all functions branching out from main(), with each function represented as a node. A purple node means that the program terminates at the function. A green node signifies that the function call has nested functions, whereas gray nodes signify otherwise. Double-clicking on a node will show its parent (colored pink) and children. The lines connecting different nodes also display how many times main() called each function.

The left window of the Radial View lists all of the functions shown in the view. This window also allows you to view nested functions, if any. A green bullet point means the program either starts or terminates at that function.

Eclipsecallgraph-radialview.png

Tree View

The Tree View is similar to the Radial View, except that it only displays all descendants of a selected node (Radial View only displays functions one call depth away from a selected node). The top left of Tree View also includes a thumbnail viewer to help you navigate through different call depths of the function tree.

Eclipsecallgraph-levelview.png

Features

Call Graph

Renders a visual function trace of the program, tracking selected or all functions.


This feature comes with a few different display options and various other information such as :

  • function parent/children relationships
  • number of times a function is called
  • time spent in an instance of a function
  • time spent in all instances of a function


File:Stapgraph menu.png

The following types of views are available to see the call hierarchy of the functions belonging to the executable.


Radial view.png Tree view.png File:Box view.png File:Aggregate view.png


Linkage To Source Code

The graph views are linked to their source code -- hold CTRL and double-click any function in a non-aggregate view to be taken to where that function was called. Doing the same for an aggregate node will take you to where that function is defined.


Function Calls In Chronological Order

Using the "Go To" menu, one can step through functions in chronological order, using the Previous/Next options.

Callgraph goto menu.png


Open / Save Call Graphs

Certain large projects might take longer to render, and so users have the ability to save the data collected from having profiled their project. Loading the data file and attempting to render that will take a much shorter time than attempting to go through the full process of profiling a project.

Callgraph file menu.png

Example.jpg

Back to the top