home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_100
/
134_01
/
cprofile.nro
< prev
next >
Wrap
Text File
|
1985-08-21
|
3KB
|
81 lines
.so AN.NRO
.TH CPROFILE 1 "BDS 'C' profiler"
.SH NAME
CPROFILE - BDS 'C' profiler
.SH SYNOPSIS
.bo
cprofile <target command> : <options> [>outfile]
.sp
Options:
.sp
.in +5
-SourceFiles file1 file2 ...
.br
-LineCount <n>
.br
-PageLength <n>
.sp
.in -5
.SH DESCRIPTION
.PP
CPROFILE is a "profiler" for BDS 'C' programs. It runs a user program (the
"target command" in the synopsis) and counts the number of times that each
source statement was executed.
.PP
To operate correctly, the target program must have been compiled with the '-k'
option (which enables the Kirkland debugger) and linked with the '-d' option
(which places restart instructions at the head of functions). In addition,
the '-ns' (no system libraries) option is recommended, so that counts are
obtained for calls to system functions.
.PP
The output from CPROFILE is an annotated source listing of the original source
program. In the left margin appear the number of times each source statement
was executed. This information is useful for performance analysis (where is
a program spending its time?), for debugging (did the program get to this
code?) and for testing (has all code been exercised?).
.PP
Several options are available to CPROFILE. CPROFILE options appear after the
target program's options, separated from it by a colon. Note that spaces
are required before and after the colon.
.PP
-PageLength sets the number of lines per page on the output listing. Default
is 58.
.PP
-LineCount sets the number of distinct source statements that are expected in
the program. Each source statement requires a six-byte table entry at run
time. Default is 500, allowing programs of up to about 500 lines to be
analyzed.
.PP
-SourceFiles is intended for use when several program or library source files
have been linked into the program. If multiple source programs have been
supplied, they must be specified here
.ul
in the same order as they were supplied to L2.
Default is <program>.C, where <program> is the name of the target command.
.SH EXAMPLES
.bo
.in +5
.ti -5
cprofile ctoa mylib.c >mylib.csm : -lc 2000 -sf ctoa.c ctoa2.c >ctoa.prf
.sp
.ti -5
cprofile myprog myfile : -pl 80
.sp
.in -5
.SH DIAGNOSTICS
.sp
"Command must be supplied."
.PP
No <target command> was supplied on the CPROFILE command line. The correct
sequence is: CPROFILE <command> <options> : <CPROFILE-options>.
.sp
"Profile table is full; abandoning program."
.PP
The program had too many source statements to analyze with the current value
of -LineCount. Rerun with a larger '-lc' option.
.sp
"Profile table overlays the profiler."
.PP
Available memory on the system is not sufficient to run CPROFILE with the
requested '-lc' option. Use a smaller '-lc'.
ed for use when several