version 1.8, 1998/09/07 16:44:33 |
version 1.9, 1998/09/26 19:54:50 |
|
|
.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 gprof |
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 gprof |
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 |
|
|
.Nm gprof |
.Nm gprof |
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 gprof |
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 |
|
|
is produced that represents |
is produced that represents |
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 gprof (probably also with a |
executions of |
|
.Nm gprof |
|
(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 |
.Pa a.out |
.Pa a.out |
|
|
.Sh FILES |
.Sh FILES |
.Bl -tag -width gmon.sum -compact |
.Bl -tag -width gmon.sum -compact |
.It Pa a.out |
.It Pa a.out |
The namelist and text space. |
namelist and text space |
.It Pa gmon.out |
.It Pa gmon.out |
Dynamic call graph and profile. |
dynamic call graph and profile |
.It Pa gmon.sum |
.It Pa gmon.sum |
Summarized dynamic call graph and profile. |
summarized dynamic call graph and profile |
.El |
.El |
.Sh SEE ALSO |
.Sh SEE ALSO |
.Xr moncontrol 3 , |
|
.Xr profil 2 , |
|
.Xr cc 1 , |
.Xr cc 1 , |
.Xr prof 1 |
.Xr prof 1 , |
|
.Xr profil 2 , |
|
.Xr moncontrol 3 |
.Rs |
.Rs |
.%T "An Execution Profiler for Modular Programs" |
.%T "An Execution Profiler for Modular Programs" |
.%A S. Graham |
.%A S. Graham |