Skip to content
BSD syscall#44

svc · unix #44

profil

Legacy BSD PC sampling profiler; deprecated in favour of Instruments and DTrace.

Prototype

int profil(short *bufbase, size_t bufsize, u_long pcoffset, u_int pcscale);

Returns: int

Arguments

NameTypeDirDescription
bufbaseshort-
bufsizesize_t-
pcoffsetu_long-
pcscaleu_int-

Version history

XNU tagmacOS#
xnu-1456.1.26macOS 10.6 Snow Leopard44
xnu-1699.24.8macOS 10.7 Lion44
xnu-1486.2.1144
xnu-1504.15.344
xnu-1504.3.1244
xnu-1504.7.444
xnu-1504.9.1744
xnu-1504.9.2644
xnu-1504.9.3744
xnu-1699.22.7344
xnu-1699.22.8144
xnu-1699.24.2344
xnu-1699.26.844
xnu-1699.32.744

Notes

profil(2) asks the kernel to maintain a histogram of the program counter inside a user-provided buffer, sampled on each clock tick. It predates kperf/Instruments and is essentially unused on modern macOS, kept around so that gprof-style profiling builds still link.

Related APIs

add_profilkperfDTracegprof