Commit | Line | Data |
---|---|---|
c579fd7e KM |
1 | .\" Copyright (c) 1980 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
ebff5f1a | 5 | .\" @(#)profil.2 6.1 (Berkeley) %G% |
c579fd7e | 6 | .\" |
ebff5f1a | 7 | .TH PROFIL 2 "" |
c579fd7e KM |
8 | .UC 4 |
9 | .SH NAME | |
10 | profil \- execution time profile | |
11 | .SH SYNOPSIS | |
12 | .nf | |
13 | .B profil(buff, bufsiz, offset, scale) | |
14 | .B char *buff; | |
15 | .B int bufsiz, offset, scale; | |
16 | .fi | |
17 | .SH DESCRIPTION | |
18 | .I Buff | |
19 | points to an area of core whose length (in bytes) is given by | |
20 | .IR bufsiz . | |
21 | After this call, the user's program counter (pc) | |
8a9565d6 | 22 | is examined each clock tick (10 milliseconds); |
c579fd7e KM |
23 | .I offset |
24 | is subtracted from it, and the result multiplied by | |
25 | .IR scale . | |
26 | If the resulting number corresponds to a word | |
27 | inside | |
28 | .I buff, | |
29 | that word is incremented. | |
30 | .PP | |
31 | The scale is interpreted as an unsigned, | |
32 | fixed-point fraction with binary point at the | |
8a9565d6 | 33 | left: 0x10000 gives a 1-1 mapping of pc's to words |
c579fd7e KM |
34 | in |
35 | .I buff; | |
8a9565d6 | 36 | 0x8000 maps each pair of instruction words |
c579fd7e | 37 | together. |
8a9565d6 | 38 | 0x2 maps all instructions onto the beginning of |
c579fd7e KM |
39 | .I buff |
40 | (producing a non-interrupting core clock). | |
41 | .PP | |
42 | Profiling is turned off by giving a | |
43 | .I scale | |
44 | of 0 or 1. | |
45 | It is rendered | |
46 | ineffective by giving a | |
47 | .I bufsiz | |
48 | of 0. | |
49 | Profiling is turned off when an | |
8a9565d6 | 50 | .I execve |
c579fd7e KM |
51 | is executed, but remains on in child and parent both |
52 | after a | |
53 | .IR fork . | |
8a9565d6 | 54 | Profiling is turned off if an update in |
c579fd7e KM |
55 | .I buff |
56 | would cause a memory fault. | |
8a9565d6 KM |
57 | .SH "RETURN VALUE |
58 | A 0, indicating success, is always returned. | |
c579fd7e | 59 | .SH "SEE ALSO" |
8a9565d6 | 60 | gprof(1), setitimer(2), monitor(3) |