'\" te .\" Copyright 1989 AT&T .TH prof 5 "3 Jul 1990" "SunOS 5.11" "Standards, Environments, and Macros" .SH NAME prof \- profile within a function .SH SYNOPSIS .LP .nf #define MARK #include \fBvoid\fR \fBMARK\fR(\fB\fR\fIname\fR); .fi .SH DESCRIPTION .sp .LP \fBMARK\fR introduces a mark called \fIname\fR that is treated the same as a function entry point. Execution of the mark adds to a counter for that mark, and program-counter time spent is accounted to the immediately preceding mark or to the function if there are no preceding marks within the active function. .sp .LP \fIname\fR may be any combination of letters, numbers, or underscores. Each \fIname\fR in a single compilation must be unique, but may be the same as any ordinary program symbol. .sp .LP For marks to be effective, the symbol \fBMARK\fR must be defined before the header \fBprof.h\fR is included, either by a preprocessor directive as in the synopsis, or by a command line argument: .sp .LP \fBcc -p -DMARK work.c\fR .sp .LP If \fBMARK\fR is not defined, the \fBMARK(\fR\fIname\fR\fB)\fR statements may be left in the source files containing them and are ignored. \fBprof -g\fR must be used to get information on all labels. .SH EXAMPLES .sp .LP In this example, marks can be used to determine how much time is spent in each loop. Unless this example is compiled with \fBMARK\fR defined on the command line, the marks are ignored. .sp .in +2 .nf #include work( ) { int i, j; . . . MARK(loop1); for (i = 0; i < 2000; i++) { . . . } MARK(loop2); for (j = 0; j < 2000; j++) { . . . } } .fi .in -2 .SH SEE ALSO .sp .LP \fBprofil\fR(2), \fBmonitor\fR(3C)