native_profil function

int native_profil(
  1. Pointer<Uint16> SampleBuffer,
  2. int size,
  3. int offset,
  4. int scale,
)

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,
  );
}