7 Using the Gprofng GUI

The gprofng-gui package provides an Oracle Java desktop application that can optionally function as a GUI front-end for the gprofng command.

It also provides a range of views and filters that can be used to customize and display the performance data that's been collected in experiments, and yield meaningful insights about where the performance bottlenecks are in an executable software program.

For more information, see http://savannah.gnu.org/projects/gprofng-gui/ and the gp-display-gui(1) manual page.

Installing gprofng-gui

Install the gprofng-gui package on Oracle Linux 8.

Before installing the gprofng-gui package, follow the steps in Installing gprofng.

Also install an Oracle Java runtime. For more information about installing Oracle Java SE, see https://docs.oracle.com/en/java/javase/index.html. On Oracle Cloud Infrastructure instances, follow the steps in Install Oracle Java SE on Oracle Linux.

The gprofng-gui package provides an optional graphical user interface for creating experiments and reviewing performance data.

  1. Install the gprofng-gui package.

    Use the dnf command to install the package:

    sudo dnf install -y gprofng-gui
  2. Verify that the gprofng-gui package has installed successfully.

    Use the gprofng command to verify its presence:

    gprofng display gui --version
The gprofng-gui package is installed.

Getting Started With gprofng-gui

Create new experiments by using the GUI front-end for gprofng.

Install the gprofng-gui package. For more information, see Installing gprofng-gui.

The gprofng-gui tool provides a GUI front-end for software engineers and testers to use for collecting performance data for in-development applications.

  1. Open a new gprofng-gui window.

    Use the gprofng command to start the application:

    gprofng display gui
  2. Click File, then Profile Application.
  3. Configure a new experiment in the Profile Application window.
    1. Set the application path, command line options, and working directory in the Specify Application to Profile section.

    2. Set the experiment file name and experiment directory in the Specify Experiment section.

    3. Configure the data that gprofng collects during the experiment in the Data to Collect tab.

  4. Start the experiment by clicking Run in the Profile Application window.

    Switch to the Output tab to see the live results of the experiment as the performance data is collected.

  5. After the experiment completes, you can open that experiment in the GUI. You can end the experiment early by clicking Terminate in the Profile Application window.

Performance data that was collected for a binary executable while the experiment was running has been saved for later review and comparison.

Reviewing Experiments With gprofng-gui

Review previous experiments by using the GUI front-end for gprofng.

Before you begin, create an experiment by using the gprofng command. For more information, see Getting Started With gprofng.

Or, create an experiment by using the gprofng-gui tool. For more information, see Getting Started With gprofng-gui.

The gprofng-gui provides a wide range of views and filters that are useful for reviewing performance data captured in software profiling experiments.

  1. Open a new gprofng-gui window.

    Use the gprofng command to start the application:

    gprofng display gui
  2. Click File, then Open Experiment.

    For experiments that were created recently, you might also see them listed under Open Recent Experiment in the File menu.

  3. If you already know the experiment directories ahead of time, you can optionally open an experiment in a single step.

    Use the gprofng command to start the application with the experiment provided as an option:

    gprofng display gui experiment1.er

    If more than one experiment is specified, they're aggregated together.

An experiment has now been opened for review purposes in the main window for the gprofng-gui tool.

Comparing Experiments With gprofng-gui

Compare experiments by using the GUI front-end for gprofng.

Before you begin, create at least two experiments by using the gprofng command. For more information, see Getting Started With gprofng.

Or, create at least two experiments by using the gprofng-gui tool. For more information, see Getting Started With gprofng-gui.

The gprofng-gui provides a wide range of views and filters that are useful for comparing performance data captured across several software profiling experiments.

  1. Open a new gprofng-gui window.

    Use the gprofng command to start the application:

    gprofng display gui
  2. Click File, then Compare Experiments.
  3. In the Compare Experiments window, specify two experiments, then click OK.

    You can add more than two experiments by clicking More. You can also switch the comparison order by clicking Reverse.

  4. If you already know the experiment directories ahead of time, you can optionally start comparing experiments in a single step.

    Use the gprofng command to start the application, with the relevant experiments listed after specifying the -c option:

    gprofng display gui -c experiment1.er experiment2.er

Two or more experiments have now been opened for comparison purposes in the main window for the gprofng-gui tool.

gprofng-gui Views Reference

This table lists the views that are displayed by default in the Views menu when at least one experiment is open in the gprofng-gui main window.

View Purpose
Callers-Callees Displays calling relationships between functions run during the experiment, along with performance metrics.
Call Tree Displays a tree node graph for calling relationships between functions run during the experiment.
Disassembly Displays instructions for a selected function run during the experiment, along with performance metrics.
Experiments Lists the experiments that are displayed in the main window, along with any notes or comments that have been added to them.
Flame Graph Displays a customizable graph for the call tree with call stacks on one axis and functions on the other. The width of the functions visually indicates the amount of CPU time used.
Functions Lists the functions run during the experiment, along with CPU performance metrics. Click the function name to see more detailed information in a separate viewing pane.
Processes Lists processes that were created during the experiment, along with performance metrics. Use filters for diagnostic purposes.
Source/Disassembly Displays source code for a selected function, with performance metrics for each line.
Threads List threads that were created during the experiment, along with performance metrics. Use filters for diagnostic purposes.
Timeline Displays color-coded performance behavior throughout the duration of the experiment, based on the performance data that was collected.

Working With the Callers-Callees View

Use the Callers-Callees view provided by gprofng-gui to diagnose performance bottlenecks in a software program at a function call level.

The Callers-Callees view displays calling relationships between functions that were run while performance data was being collected, along with performance metrics.

The view is split into three horizontal panel. The middle panel displays the selected function. Other functions that make calls to the selected function are displayed in the upper panel, and any functions that are called by the selected function are displayed in the panel underneath.

A separate viewing pane displays extra information when a function is selected.

Working With the Call Tree View

Use the Call Tree view provided by gprofng-gui to diagnose performance bottlenecks in a software program at a function call level.

The Call Tree view displays a tree graph that reflects calling relationships between functions that were run while performance data was being collected, along with performance metrics.

Each function call is allocated a tree node that can be expanded and collapsed to display a list of related function calls, and those in turn are also allocated tree nodes that can be expanded and collapsed as needed. Selecting any function updates the Selection Details window with further details about that function and performance metrics.

To review the chain of function calls that has the most significant performance bottleneck, right-click any node, and then select Expand Hottest Branch.

Working With the Functions View

Use the Functions view provided by gprofng-gui to diagnose performance bottlenecks in a software program at function level.

The Functions view displays a listing of all the functions that were run while performance data was being collected during an experiment.

By default, functions are listed next to their CPU time usage data. Clicking on any function name displays further details in a separate viewing pane.

Double-clicking on a function name opens that function in a new Source view, which fills a separate viewing pane with a list of code lines annotated with performance metrics.

Functions can also be reviewed in the Source/Disassembly view to see a larger split pane view in the main window between source code and performance data annotations. Computationally expensive lines are highlighted with a different background color.

Working With the Timeline View

Use the Timeline view provided by gprofng-gui to diagnose performance bottlenecks in a software program that are triggered at a particular stage of execution or build up over time.

The Timeline view displays a color-coded timeline map of performance data that was collected while the experiment was running.

The Time axis displays the timeline, and on the other axis a series of bars represents each thread that was spawned during the experiment. The call stacks of the application are plotted as vertical bars. Each function or method that's called during the experiment is assigned a different color, and those colors are used in the vertical bars to represent those calls on the timeline.

The OS has its own unique bar at the top of the map area, and its background color indicates whether the application was still running in userspace or not.

Clicking anywhere within those bars highlights a particular point in the timeline, and further details are then displayed in a separate viewing pane.

The scale of the timeline can be changed by clicking on the Zoom in and Zoom out icons, or by highlighting a specific region in the Time axis with the mouse cursor and then pressing the Enter key.

Clicking the provided navigation arrows moves the timeline between threads and events within the timeline, and also updates any related viewing panes.

The Timeline view can also be customized to display other performance metrics over time, such as CPU usage and processes instead of threads. Use the Group Data by pull-down menu to select the performance metric to display.

Click the Function Colors button to change the colors that are assigned for any or all the functions that were called during the experiment. If all the functions are set to the same color except one, then it can make tracking the performance of that one specific function through the timeline more straightforward.

The Timeline view can also filter performance data so that only the most relevant threads or functions are displayed. Those filter options are provided in the Tools menu, or you can use the Filter icon within the Timeline view to apply a default selection of filters.