]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/profil.3
Import of man-pages 1.70
[thirdparty/man-pages.git] / man3 / profil.3
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified Fri Jun 23 01:35:19 1995 Andries Brouwer <aeb@cwi.nl>
26 .\" (prompted by Bas V. de Bakker <bas@phys.uva.nl>)
27 .\" Corrected (and moved to man3), 980612, aeb
28 .TH PROFIL 3 1993-07-23 "Linux 2.0" "Linux Programmer's Manual"
29 .SH NAME
30 profil \- execution time profile
31 .SH SYNOPSIS
32 .B #include <unistd.h>
33 .sp
34 .BI "int profil(u_short *" buf ", size_t " bufsiz ", size_t " offset ", u_int " scale );
35 .SH DESCRIPTION
36 This routine provides a means to find out in what areas your program
37 spends most of its time. The argument
38 .I buf
39 points to
40 .I bufsiz
41 bytes of core. Every virtual 10 milliseconds, the user's program counter (PC)
42 is examined:
43 .I offset
44 is subtracted and the result is multiplied by
45 .IR scale
46 and divided by 65536.
47 If the resulting value is less than
48 .IR bufsiz ,
49 then the corresponding entry in
50 .I buf
51 is incremented.
52 If
53 .I buf
54 is NULL, profiling is disabled.
55 .SH "RETURN VALUE"
56 Zero is always returned.
57 .SH BUGS
58 .B profil
59 cannot be used on a program that also uses
60 .B ITIMER_PROF
61 itimers.
62
63 True kernel profiling provides more accurate results.
64 Libc 4.4 contained a kernel patch providing a system call profil.
65 .SH "CONFORMING TO"
66 Similar to a call in SVr4 (but not POSIX.1).
67 .SH "SEE ALSO"
68 .BR gprof (1),
69 .BR setitimer (2),
70 .BR sigaction (2),
71 .BR signal (2)