3 Getting Started With gprofng

Creating an experiment directory, capturing performance data, and inspecting the results.

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

The gprofng profiling tool can be used to assist development teams seeking to optimize their code and improve application performance.

  1. Set up the experiment directory.

    You can run the gprofng command inside any directory because it generates the necessary directory structure automatically.

    Consider creating a separate directory for the performance experiments. That directory can be stored anywhere, for example in the user home directory or as an unversioned subdirectory within a code project folder.

  2. Collect performance data for a program.

    Use the gprofng collect app command to start the application and collect performance data while it runs:

    gprofng collect app /path/to/application -options
  3. Review the performance data that has been captured.

    Use the gprofng display text command to analyze the performance data. By default, experiment results are stored in an experiment directory that follows the test.n.er naming pattern, where n is a numerical identifier for the test and .er is a required suffix.

    For example, to review the performance data stored in the test.1.er directory, run the following command:

    gprofng display text -functions test.1.er

An experiment directory has been created, performance data was captured, and the test directory in which that performance data is stored can be analyzed by using the gprofng display command.