BSD 4_3_Net_2 release
[unix-history] / usr / src / usr.bin / pascal / pxp / pxp.1
.\" Copyright (c) 1980, 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)pxp.1 6.6 (Berkeley) 6/2/91
.\"
.Dd June 2, 1991
.Dt PXP 1
.Os BSD 3
.Sh NAME
.Nm pxp
.Nd Pascal execution profiler
.Sh SYNOPSIS
.Nm pxp
.Op Fl acdefjnstuw_
.Op Fl 23456789
.Op Fl z Op Ar name ...
.Ar name.p
.Sh DESCRIPTION
.Nm Pxp
can be used to obtain execution profiles of Pascal programs or
as a pretty-printer.
To produce an execution profile all that is necessary is to translate
the program specifying the
.Fl z
option to
.Xr pi 1
or
.Xr pix 1 ,
to execute the program,
and to then issue the command
.Bd -literal -offset indent
pxp -x name.p
.Ed
.Pp
A reformatted listing is output if none of the
.Fl c ,
.Fl t ,
or
.Fl z
options are specified;
thus
.Bd -literal -offset indent
pxp old.p > new.p
.Ed
.Pp
places a pretty-printed version of the program in `old.p' in the file `new.p'.
.Pp
The use of the following options of
.Nm pxp
is discussed in sections 2.6, 5.4, 5.5 and 5.10 of the
.%T "Berkeley Pascal User's Manual" .
.Bl -tag -width Fl
.It Fl a
Print the bodies of all procedures and functions in the profile;
even those which were never executed.
.It Fl c
Extract profile data from the file
.Pa core .
.It Fl d
Include declaration parts in a profile.
.It Fl e
Eliminate
.Ic include
directives when reformatting a file;
the
.Ic include
is replaced by the reformatted contents of the specified
file.
.It Fl f
Fully parenthesize expressions.
.It Fl j
Left justify all procedures and functions.
.It Fl n
Eject a new page
as each file is included;
in profiles, print a blank line at the top of the page.
.It Fl s
Strip comments from the input text.
.It Fl t
Print a table summarizing
.Ic procedure
and
.Ic function
call counts.
.It Fl u
Card image mode; only the first 72 characters of input lines
are used.
.It Fl w
Suppress warning diagnostics.
.It Fl z
Generate an execution profile.
If no
.Ar name Ns 's
are given the profile is of the entire program.
If a list of names is given, then only any specified
.Ic procedure Ns s
or
.Cx Ic function Ns s
and the contents of any specified
.Ic include
files will appear in the profile.
.It Fl \&_
Underline keywords.
.It Fl d
With
.Ar d
a digit, 2 \*(Le
.Ar d
\*(Le 9,
causes
.Nm pxp
to use
.Ar d
spaces as the basic indenting unit.
The default is 4.
.El
.Sh FILES
.Bl -tag -width /usr/lib/how_pxp -compact
.It Pa name.p
input file
.It Pa name.i
include file(s)
.It Pa pmon.out
profile data
.It Pa core
profile data source with
.Fl c
.It Pa /usr/lib/how_pxp
information on basic usage
.El
.Sh SEE ALSO
.Xr pi 1 ,
.Xr px 1
.Rs
.%T "Berkeley Pascal User's Manual"
.Re
.Sh DIAGNOSTICS
For a basic explanation do
.Bd -literal -offset indent
pxp
.Ed
.Pp
Error diagnostics include
`No profile data in file'
with the
.Fl c
option if the
.Fl z
option was not enabled to
.Nm pi ;
`Not a Pascal system core file'
if the core is not from a
.Nm px
execution;
`Program and count data do not correspond'
if the program was changed after compilation, before profiling;
or if the wrong program is specified.
.Sh HISTORY
.Nm Pxp
appeared in
.Bx 3.0 .
.Sh BUGS
Does not place multiple statements per line.