version 1.11, 1999/06/05 01:21:27 |
version 1.12, 1999/07/04 11:53:54 |
|
|
.Op options |
.Op options |
.Op Ar a.out Op Ar gmon.out ... |
.Op Ar a.out Op Ar gmon.out ... |
.Sh DESCRIPTION |
.Sh DESCRIPTION |
.Nm gprof |
.Nm |
produces an execution profile of C, Pascal, or Fortran77 programs. |
produces an execution profile of C, Pascal, or Fortran77 programs. |
The effect of called routines is incorporated in the profile of each caller. |
The effect of called routines is incorporated in the profile of each caller. |
The profile data is taken from the call graph profile file |
The profile data is taken from the call graph profile file |
|
|
.Fl pg |
.Fl pg |
option also links in versions of the library routines |
option also links in versions of the library routines |
that are compiled for profiling. |
that are compiled for profiling. |
.Nm gprof |
.Nm |
reads the given object file (the default is |
reads the given object file (the default is |
.Pa a.out) |
.Pa a.out) |
and establishes the relation between its symbol table |
and establishes the relation between its symbol table |
|
|
.Pa gmon.out . |
.Pa gmon.out . |
If more than one profile file is specified, |
If more than one profile file is specified, |
the |
the |
.Nm gprof |
.Nm |
output shows the sum of the profile information in the given profile files. |
output shows the sum of the profile information in the given profile files. |
.Pp |
.Pp |
.Nm gprof |
.Nm |
calculates the amount of time spent in each routine. |
calculates the amount of time spent in each routine. |
Next, these times are propagated along the edges of the call graph. |
Next, these times are propagated along the edges of the call graph. |
Cycles are discovered, and calls into a cycle are made to share the time |
Cycles are discovered, and calls into a cycle are made to share the time |
|
|
or more members. |
or more members. |
Caution: the algorithm used to break cycles is exponential, |
Caution: the algorithm used to break cycles is exponential, |
so using this option may cause |
so using this option may cause |
.Nm gprof |
.Nm |
to run for a very long time. |
to run for a very long time. |
.It Fl e Ar name |
.It Fl e Ar name |
Suppresses the printing of the graph profile entry for routine |
Suppresses the printing of the graph profile entry for routine |
|
|
the sum of the profile information in all the specified profile files. |
the sum of the profile information in all the specified profile files. |
This summary profile file may be given to later |
This summary profile file may be given to later |
executions of |
executions of |
.Nm gprof |
.Nm |
(probably also with a |
(probably also with a |
.Fl s ) |
.Fl s ) |
to accumulate profile data across several runs of an |
to accumulate profile data across several runs of an |
|
|
.Re |
.Re |
.Sh HISTORY |
.Sh HISTORY |
The |
The |
.Nm gprof |
.Nm |
profiler |
profiler |
appeared in |
appeared in |
.Bx 4.2 . |
.Bx 4.2 . |