Enumerations

enum class SamplingState : uint8_t
Name Value Comments
Unallocated 0

The idle state for the sampler. We're not actively sampling nor is there a user handle
associated with the thread sampler singleton.

Configured 1

We have buffers allocated and the user has a handle to us and can start a session. Reading is
allowed, but not writing.

Running 2

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

Stopping 3

The session is stopping, no more write references to the buffers are allowed to be created and
we're waiting for existing write references to be released.

Destroying 4

We have stopped giving out read references and are waiting for all existing read references to
close. Once there are no buffer references, we'll destroy the buffers and become unallocated.

The current state of the sampler.

Valid state transitions are:

```

/- [ Destroying ]

<

- --

\

| |

v |

[ Unallocated ] -> [ Configured ] -> [ Running ]

^ |

| v

\

-[ Stopping ]

```

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

Records

Functions

  • void sampler_percpu_init ()

    Joins the sampling session on the current cpu if one exists.

    Defined at line 27 of file ../../zircon/kernel/lib/thread_sampler/thread_sampler.cc

  • void sampler_percpu_shutdown ()

    Exit the sampling session on the current cpu if one exists.

    Defined at line 28 of file ../../zircon/kernel/lib/thread_sampler/thread_sampler.cc

Variables

ThreadSampler gThreadSampler

Defined at line 25 of file ../../zircon/kernel/lib/thread_sampler/thread_sampler.cc