1PROFIL(3) Linux Programmer's Manual PROFIL(3)
2
3
4
6 profil - execution time profile
7
9 #include <unistd.h>
10
11 int profil(unsigned short *buf, size_t bufsiz,
12 size_t offset, unsigned int scale);
13
14 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
15
16 profil(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
17
19 This routine provides a means to find out in what areas your program
20 spends most of its time. The argument buf points to bufsiz bytes of
21 core. Every virtual 10 milliseconds, the user's program counter (PC)
22 is examined: offset is subtracted and the result is multiplied by scale
23 and divided by 65536. If the resulting value is less than bufsiz, then
24 the corresponding entry in buf is incremented. If buf is NULL, profil‐
25 ing is disabled.
26
28 Zero is always returned.
29
31 Similar to a call in SVr4 (but not POSIX.1-2001).
32
34 profil() cannot be used on a program that also uses ITIMER_PROF inter‐
35 val timers (see setitimer(2)).
36
37 True kernel profiling provides more accurate results. Libc 4.4 con‐
38 tained a kernel patch providing a system call profil.
39
41 gprof(1), setitimer(2), sigaction(2), signal(2)
42
44 This page is part of release 3.53 of the Linux man-pages project. A
45 description of the project, and information about reporting bugs, can
46 be found at http://www.kernel.org/doc/man-pages/.
47
48
49
50Linux 2007-07-26 PROFIL(3)