PROF(1,C) AIX Commands Reference PROF(1,C)
-------------------------------------------------------------------------------
prof
PURPOSE
Displays program profile data.
SYNTAX
+--- -t ----+ +--------+ +-----------+ +- a.out -+ +- -m mon.out -+
prof --| one of |--| one of |--| +-------+ |-| |-| |--|
| +-------+ | | +----+ | +-| -g -s |-+ +- prog --+ +-- -m data ---+
+-| -a -n |-+ +-| -o |-+ ^| -h -z ||
| -c -t | | -x | || -S ||
| -l | +----+ || -v ||
+-------+ |+-------+|
+---------+
DESCRIPTION
The prof command interprets profile data collected by the monitor subroutine
for the object file prog (a.out by default). It reads the symbol table in the
object file prog and correlates it with the profile file (mon.out by default).
prof displays, for each external text symbol, the percentage of execution time
spent between the address of that symbol and the address of the next, the
number of times that function was called, and the average number of
milliseconds per call.
For the number of calls to a function to be tallied, you must have compiled the
file using the -p flag of the cc command. This flag also arranges for the
object file to include a special profiling startup function that calls the
monitor subroutine at the beginning and end of execution. It is the call to
monitor at the end of execution that writes mon.out. Thus, only programs that
explicitly exit or return from main cause the mon.out file to be produced.
Note: No more than 600 functions can have call counters established during
program execution. If you exceed this limit, prof overwrites other data
and damages the mon.out file. prof automatically reports the number of
call counters used whenever the number exceeds 500.
FLAGS
The mutually exclusive flags a, c, n, and t determine how prof sorts the output
lines:
-a or -l
Sorts by increasing symbol address.
Processed November 8, 1990 PROF(1,C) 1
PROF(1,C) AIX Commands Reference PROF(1,C)
-c Sorts by decreasing number of calls.
-n Sorts lexically by symbol name.
-t Sorts by decreasing percentage of total time (default).
The mutually exclusive flags o and x specify how to display the address of each
symbol monitored.
-o Displays each address in octal, along with the symbol name.
-x Displays each address in hexadecimal, along with the symbol name.
Use the following flags in any combination:
-g Includes non-global symbols (static functions).
-h Suppresses the heading normally displayed on the report. (This is
useful if the report is to be processed further.)
-m mdata
Takes profiling data from mdata instead of mon.out. The -m flag is
optional if prog is specified.
-s Produces a summary file in mon.sum. This is only useful when more than
one profile is specified.
-S Displays a summary of monitoring parameters and statistics on standard
error.
-z Includes all symbols in the profile range, even if associated with zero
calls and zero time.
-v Suppresses all printing and produces a graphic version of the profile
on the standard output for display by the plot filters. When plotting,
the numbers low and high by default 0 and 100, may be given to cause a
selected percentage of the profile to be plotted with accordingly
higher resolution.
FILES
mon.out Default profile.
a.out Default object file.
RELATED INFORMATION
See the following commands: "cc" and "nm."
See the exit and profil system calls and the monitor subroutine in AIX
Operating System Technical Reference.
Processed November 8, 1990 PROF(1,C) 2