## Summary

Begin sampling to the provided IOBuffer.

## Declaration

    #include <zircon/syscalls.h>

    zx_status_t zx_sampler_start(zx_handle_t iobuffer);

## Description

Begin sampling each attached thread and writing each sample to the
provided IOBuffer. The provided IOBuffer must be one previously returned
by zx_sampler_create.

Attempting to start a session which has already been started will return
an error, but will not stop or otherwise modify the session.

Restarting a previously started/stopped session will continue writing to
the buffers where the previous session left off.

## Errors

`ZX_ERR_NOT_SUPPORTED` `kernel.enable-debugging-syscalls` is not set to `true`
on the kernel command line.

`ZX_ERR_PERMISION_DENIED` *iobuffer* is not an IOBuffer returned by zx_sampler_create.

`ZX_ERR_BAD_STATE` the sampler has already been started.

## See also

- [`zx_sampler_create()`](https://fuchsia.dev/reference/syscalls/sampler_create)
- [`zx_sampler_stop()`](https://fuchsia.dev/reference/syscalls/sampler_stop)