gprof.1 (2010 09)

g
gprof(1) gprof(1)
gcrt0.o or mcrt0.o. This turns on profiling of
a.out, which is not compatible with profiling of
shared libraries. You can either profile your executable or a shared library, but not both.
Set
LD_PROFILE to the exact string with which you call
shl_load. If the library is implicitly
loaded,
LD_PROFILE must match the path encoded in the
a.out. You can find this value by run-
ning the
ldd command on the executable.
At the termination of the program, a profile file with the name of the shared library prepended to it
is generated by a run-time library. To get the complete listing, provide the
gprof command with
names of the shared library and the profile file for the shared library as arguments.
Options
The
gprof command recognizes the following options:
-a Suppress printing statically declared functions. If this option is given, all relevant
information about the static function (such as time samples, calls to other functions,
and calls from other functions) belongs to the function loaded just before the static
function in the a.out file.
-b Suppress printing a description of each field in the profile.
-e name Suppress printing the graph profile entry for routine name and all its descendants
(unless they have other ancestors that are not suppressed). More than one
-e
option can be given. Only one name can be given with each -e option.
-E name Suppress printing the graph profile entry for routine name (and its descendants) as
-e above, and also exclude the time spent in name (and its descendants) from the
total and percentage time computations.
-E mcount -E mcleanup is the
default.
-f name Print only the graph profile entry of the specified routine name and its descendants.
More than one
-f option can be given. Only one name can be given with each -f
option.
-F name Print only the graph profile entry of the routine name and its descendants (as
-f
above) and also use only the times of the printed routines in total time and percen-
tage computations. More than one
-F option can be given. Only one name can be
given with each
-F option. The -F option overrides the -E option.
-p Produce just the flat profile output exactly similar to one given by
prof (see
prof (1)).
-s Produce a profile file gmon.sum that represents the sum of the profile information
in all specified profile files. This summary profile le can be given to subsequent
executions of gprof (probably also with a -s option) to accumulate profile data
across several runs of an a.out file. LD_PROFILE should be set to the same
string for all the runs.
-t Produce just the static output in gprof. This is used for testing purposes. It elim-
inates all the timing information from normal gprof output and reports only the
call count part.
-z Display routines that have zero usage (as indicated by call counts and accumulated
time).
The environment variable
GPROFDIR controls the name of the file created by a profiled program. If
GPROFDIR is not set, gmon.out is produced in the current directory when the program terminates. If
GPROFDIR=string, string /pid.progname is produced, where progname is argv[0] with any path prefix
removed, and pid is the programs process ID. If GPROFDIR is set to a null string, no profiling output is
produced.
EXTERNAL INFLUENCES
Environment Variables
LD_PROFILE determines the modules to be profiled.
LD_PROFILEBUCKET_SIZE
controls the size of profiling counters.
GPROFDIR controls the path and name of the file created by a profiled program.
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010