]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/profil.3
ioctl_console.2, ctime.3: tfix
[thirdparty/man-pages.git] / man3 / profil.3
CommitLineData
fea681da
MK
1.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
c13182ef 12.\"
fea681da
MK
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
c13182ef 20.\"
fea681da
MK
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
fea681da
MK
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
4b8c67d9 28.TH PROFIL 3 2017-09-15 "Linux" "Linux Programmer's Manual"
fea681da
MK
29.SH NAME
30profil \- execution time profile
31.SH SYNOPSIS
9ccfb102 32.nf
fea681da 33.B #include <unistd.h>
68e4db0a 34.PP
9ccfb102
MK
35.BI "int profil(unsigned short *" buf ", size_t " bufsiz ,
36.BI " size_t " offset ", unsigned int " scale );
68e4db0a 37.PP
9ccfb102 38.fi
cc4615cc
MK
39.in -4n
40Feature Test Macro Requirements for glibc (see
41.BR feature_test_macros (7)):
42.in
68e4db0a 43.PP
cc4615cc 44.BR profil ():
2c767761 45.nf
d0544534
MK
46 Since glibc 2.21:
47.\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8
48 _DEFAULT_SOURCE
49 In glibc 2.19 and 2.20:
50 _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
51 Up to and including glibc 2.19:
52 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
53.fi
fea681da
MK
54.SH DESCRIPTION
55This routine provides a means to find out in what areas your program
c13182ef
MK
56spends most of its time.
57The argument
fea681da
MK
58.I buf
59points to
60.I bufsiz
c13182ef
MK
61bytes of core.
62Every virtual 10 milliseconds, the user's program counter (PC)
fea681da
MK
63is examined:
64.I offset
65is subtracted and the result is multiplied by
0daa9e92 66.I scale
fea681da
MK
67and divided by 65536.
68If the resulting value is less than
69.IR bufsiz ,
70then the corresponding entry in
71.I buf
72is incremented.
73If
74.I buf
75is NULL, profiling is disabled.
47297adb 76.SH RETURN VALUE
fea681da 77Zero is always returned.
44518c2d
ZL
78.SH ATTRIBUTES
79For an explanation of the terms used in this section, see
80.BR attributes (7).
81.TS
82allbox;
83lb lb lb
84l l l.
85Interface Attribute Value
86T{
87.BR profil ()
88T} Thread safety MT-Unsafe
89.TE
847e0d88 90.sp 1
47297adb 91.SH CONFORMING TO
7230317f 92Similar to a call in SVr4 (but not POSIX.1).
fea681da 93.SH BUGS
e511ffb6 94.BR profil ()
fea681da
MK
95cannot be used on a program that also uses
96.B ITIMER_PROF
65e8e0f5
MK
97interval timers (see
98.BR setitimer (2)).
847e0d88 99.PP
fea681da
MK
100True kernel profiling provides more accurate results.
101Libc 4.4 contained a kernel patch providing a system call profil.
47297adb 102.SH SEE ALSO
fea681da 103.BR gprof (1),
5f97eb3b 104.BR sprof (1),
fea681da
MK
105.BR setitimer (2),
106.BR sigaction (2),
107.BR signal (2)