gperf.1 2.51 KB
.TH gperf 1P local "Silicon Graphics, Inc."
.SH NAME
gperf \- analyze profile data
.SH SYNOPSIS
\f3gperf\f1 [-c] [-r] [-s] [-t threshold] a.out
.SH DESCRIPTION
The
.I gperf
program converts the output data produced by the 
.I osProfile (3P)
functions along with symbol table informtation from
.I a.out
(or your executable's name) into a printed report detailing the 
relative time spent by the program in various functions.  This 
data is obtained using
.B pc-sampling
which interrupts the program at regular intervals, recording the value 
of the program counter.
.PP
.I Gperf
can operate in a query mode (default), in which each execution sends a 
request to the program running on the development board for profile data.
The profiled data is transferred back to the host and displayed by
.I gperf.
After displaying the data, gperf exits.
.I Gperf
can also be run in a server mode,
.B \-s 
option,
in which it spins waiting for the program to execute the
.I osProfileFlush
function.
.I Gperf
will then display the data and wait for the next
.I osProfileFlush.
.PP
.I Gperf
will always display the address of the function being displayed, the function 
name, and the percent of execution time used by the function.  An example of
.I gperf's
output is:
.PP
.nf
-------------------------------------------------------------
Profile Report for osprof
Number of text symbols: 195
Sample period: 1000 microseconds
Number of profiled segments: 2
Text segment 0, start = 80200050, size = 000000d4
Text segment 1, start = 80200470, size = 000031cc
-------------------------------------------------------------


80202088  osProfileStop..............................    0.0616 %
80201720  osSetThreadPri.............................    0.1232 %
Overflow  ...........................................   99.8152 %
.fi
.SS Options
.TP
.B \-c
Display the raw counts for each text symbol.  The -t option will then
use units of raw counts for the threshold.
.TP
.B \-r
Display the time used by each text symbol in seconds.
.TP
.B \-s
Execute in server mode, i.e.  wait for a flush from application rather than
initiating a flush from 
.I gperf
and don't exit.  Note that the application must cooperate
by sending a 
.I osProfileFlush.
.TP
.B \-t threshold
Define a threshold value at which to print results.  Default value is 1.0.
If the -c option is used, the threshold is in units of raw counts, otherwise
the units are percent of execution time.
.SH BUGS
If you execute
.I gperf
without the 
.B \-s
option and the application executes a 
.I osProfileFlush, 
the application will hang.