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 | .\" | |
729abab1 | 5 | .\" @(#)profil.2 6.2 (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, | |
729abab1 MK |
32 | fixed-point fraction with 16 bits of fraction: |
33 | 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. |
c579fd7e KM |
38 | .PP |
39 | Profiling is turned off by giving a | |
40 | .I scale | |
41 | of 0 or 1. | |
42 | It is rendered | |
43 | ineffective by giving a | |
44 | .I bufsiz | |
45 | of 0. | |
46 | Profiling is turned off when an | |
8a9565d6 | 47 | .I execve |
c579fd7e KM |
48 | is executed, but remains on in child and parent both |
49 | after a | |
50 | .IR fork . | |
8a9565d6 | 51 | Profiling is turned off if an update in |
c579fd7e KM |
52 | .I buff |
53 | would cause a memory fault. | |
8a9565d6 KM |
54 | .SH "RETURN VALUE |
55 | A 0, indicating success, is always returned. | |
c579fd7e | 56 | .SH "SEE ALSO" |
8a9565d6 | 57 | gprof(1), setitimer(2), monitor(3) |