Namespaces

Enumerations

enum class SamplingState : uint8_t
Name Value Comments
Unallocated 0

There are no buffers allocated for the sampler. This should only occur if the sampler has
never been used. Once we allocate buffers once, we never dealloc them.

Allocated 1

The idle state for the sampler. We have buffers allocated, but we're not actively sampling
nor is there a user handle associated with us.

Configured 2

We have buffers allocated and the user has a handle to us and can start a session.

Running 3

The session is in progress. We are taking samples and writing data.

Reading 4

We have a read in flight. If we get a destruction request, we need to delay destruction of
resources until the read as completed.

Destroying 5

We requested a session teardown while were we reading. Once the read finishes, we'll clear the
buffers and become allocated.

The current state of the sampler.

Valid state transitions are:

```

/---------------------------

\

/----------

\

v | v |

[ Unallocated ] -> [ Allocated ] -> [ Configured ] -> [ Running ] -> [ Reading ]

^ ^ | |

|

\

---------/ |

\

----------------------------[ Destroying ]

<

---/

```

Defined at line 43 of file ../../zircon/kernel/lib/thread_sampler/include/lib/thread_sampler/thread_sampler.h

Records