PROFIL(2)

NAME
profil - execution time profile

SYNOPSIS
#include <unistd.h>

int profil(char *buf, int bufsiz, int offset, int scale);

DESCRIPTION
Under Linux 0.99.11, profil is not implemented in the kernel. Instead, the DLL 4.4.1 libraries provide a user-space implementation. Buf points to bufsiz bytes of core. Every virtual 10 milliseconds, the user's program counter (PC) is examined: offset is subtracted and the result is multiplied by scale. If this address is in buf, then the word pointed to is incremented. If scale is less than 2 or bufsiz is zero, profiling is disabled.

RETURN VALUE
Zero is always returned.

BUGS
profil cannot be used on a program that also uses ITIMER_PROF itimers. Calling profil with an invalid buf will result in a core dump. True kernel profiling provides more accurate results.

CONFORMING TO
Similar to a call in SVr4 (but not POSIX.1). However, in the SVr4 version the first argument is short *, allowing higher counter values.

SEE ALSO
gprof(1), setitimer(2), signal(2), sigaction(2)