2 .\" Copyright 1989 AT&T
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH PROF 5 "Jul 3, 1990"
8 prof \- profile within a function
15 \fBvoid\fR \fBMARK\fR(\fB\fR\fIname\fR);
21 \fBMARK\fR introduces a mark called \fIname\fR that is treated the same as a
22 function entry point. Execution of the mark adds to a counter for that mark,
23 and program-counter time spent is accounted to the immediately preceding mark
24 or to the function if there are no preceding marks within the active function.
27 \fIname\fR may be any combination of letters, numbers, or underscores. Each
28 \fIname\fR in a single compilation must be unique, but may be the same as any
29 ordinary program symbol.
32 For marks to be effective, the symbol \fBMARK\fR must be defined before the
33 header \fBprof.h\fR is included, either by a preprocessor directive as in the
34 synopsis, or by a command line argument:
37 \fBcc -p -DMARK work.c\fR
40 If \fBMARK\fR is not defined, the \fBMARK(\fR\fIname\fR\fB)\fR statements may
41 be left in the source files containing them and are ignored. \fBprof -g\fR
42 must be used to get information on all labels.
46 In this example, marks can be used to determine how much time is spent in each
47 loop. Unless this example is compiled with \fBMARK\fR defined on the command
48 line, the marks are ignored.
58 for (i = 0; i < 2000; i++) {
62 for (j = 0; j < 2000; j++) {
72 \fBprofil\fR(2), \fBmonitor\fR(3C)