prof produces an execution profile of a program. The profile data is taken from the profile file which is created by programs compiled with the -p option of cc.1v and other compilers. That option also links in versions of the library routines (see monitor.3 which are compiled for profiling. The symbol table in the executable image file image-file (a.out by default) is read and correlated with the profile file profile-file (mon.out by default). For each external symbol, the percentage of time spent executing between that symbol and the next is printed (in decreasing order), together with the number of times that routine was called and the number of milliseconds per call. If more than one profile file is specified, the prof output shows the sum of the profile information in the given profile files.
To tally the number of calls to a routine, the modules that make up the program must be compiled with the 'cc -p' option (see cc.1v This option also means that the profile file is produced automatically.
A single function may be split into subfunctions for profiling by means of the MARK macro (see prof.3
Beware of quantization errors.
The profiled program must call exit.2v or return normally for the profiling information to be saved in the mon.out file.
prof is confused by the FORTRAN compiler which puts the entry points at the bottom of subroutines and functions.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97