1 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" Modified Fri Jun 23 01:35:19 1995 Andries Brouwer <aeb@cwi.nl>
6 .\" (prompted by Bas V. de Bakker <bas@phys.uva.nl>)
7 .\" Corrected (and moved to man3), 980612, aeb
8 .TH PROFIL 3 2021-03-22 "Linux man-pages (unreleased)"
10 profil \- execution time profile
13 .RI ( libc ", " \-lc )
16 .B #include <unistd.h>
18 .BI "int profil(unsigned short *" buf ", size_t " bufsiz ,
19 .BI " size_t " offset ", unsigned int " scale );
23 Feature Test Macro Requirements for glibc (see
24 .BR feature_test_macros (7)):
30 .\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8
32 In glibc 2.19 and 2.20:
33 _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
34 Up to and including glibc 2.19:
35 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
38 This routine provides a means to find out in what areas your program
39 spends most of its time.
45 Every virtual 10 milliseconds, the user's program counter (PC)
48 is subtracted and the result is multiplied by
51 If the resulting value is less than
53 then the corresponding entry in
58 is NULL, profiling is disabled.
60 Zero is always returned.
62 For an explanation of the terms used in this section, see
70 Interface Attribute Value
73 T} Thread safety MT-Unsafe
79 Similar to a call in SVr4 (but not POSIX.1).
82 cannot be used on a program that also uses
87 True kernel profiling provides more accurate results.
88 .\" Libc 4.4 contained a kernel patch providing a system call profil.