native_profil function
Enable statistical profiling, writing samples of the PC into at most
SIZE bytes of SAMPLE_BUFFER; every processor clock tick while profiling
is enabled, the system examines the user PC and increments
SAMPLE_BUFFER((PC - OFFSET) / 2) * SCALE / 65536
. If SCALE is zero,
disable profiling. Returns zero on success, -1 on error.
Implementation
int native_profil(
ffi.Pointer<ffi.Uint16> SampleBuffer,
int size,
int offset,
int scale,
) {
_profil ??= Libc().dylib.lookupFunction<
ffi.Int32 Function(
ffi.Pointer<ffi.Uint16>, ffi.Uint64, ffi.Uint64, ffi.Uint32),
_dart_profil>('profil');
return _profil!(
SampleBuffer,
size,
offset,
scale,
);
}