PROF(1) — Kubota Pacfic Computer Inc. (Extended Software Generation Utilities)
NAME
prof, mkprof − display profile data
SYNOPSIS
prof [−v] [prog] mkprof [−sn] [−Tletter] inprog outprog
DESCRIPTION
The prof command interprets a profile file (called mon.out ) produced by running a profiled program. The symbol table in the object file prog (a.out by default) is read and correlated with the profile file. For each function the number of calls of that routine and the total time spent in each routine are reported. In the event that the program ran multiprocessor, the number of calls and the total time are reported for each thread of the process. If the [−v] option is in force, the percentage of the total time, and the average time per call are also reported.
There are two ways to profile a program. A program creates a profile file if it has been loaded with the −p option of cc(1) or fc(1). Note that, unlike most other implementations, it is not necessary to recompile each routine with −p to obtain routine counts; the effect takes place on the loading step.
The other way to profile is to use the mkprof command. To create a profiled version yyy of the program xxx the command mkprof xxx yyy is run. When yyy is run, a mon.out file is produce which can be interpreted by prof.
There are two options that can be accessed by mkprof only. The option −sn sets the scale factor to n. The hardware clock is in ticks (16ths of a microsecond). The scale factor tells how many bits to shift this to obtain the time that is reported by the profiler. By default, the scale factor is 4, which means that the default unit of time is microseconds. By increasing the scale factor, long-running programs can be timed with no danger of overflowing the (32-bit) counters. The scale factor is kept in the mon.out file and is automatically picked up and interpreted by prof.
The option −Tletter allows you to specify a particular timing function. If letter is f, the FPU time is used (the default setting). If letter is c, the CPU time is used. If letter is e, the elapsed time is used. The letter specified in letter can be in either upper or lower case. CPU time and elapsed time are always measured in ticks (hundredths of a second). The -s (scale) option is ignored when either −Tc or −Te is specified.
FILES
mon.outfor profile
a.outfor namelist
SEE ALSO
WARNINGS AND BUGS
The times reported in successive identical runs may show variances due to sharing of the cache with other processes and other effects.
Certain effects (e.g., paging, ETLB misses) may have a significant effect on the real-time performance of programs, but will not show up in these profiled numbers.
There is a very slight chance that, on long programs on busy machines, the clock will ’turn over’ at the wrong time and some routine will be charged for 2∗∗35 (i.e 2 to the power of 35) extra clock ticks. This i effect should be reasonably obvious.
Call counts are always recorded precisely.
September 02, 1992