---
title: Kernel Structure
---
flowchart TD
    A(UserPrograms) --- B
    B(zx_sampler_create) --- C
    C(ThreadSamplerDispatcher) --- D
    D("CreateSession
    EnableSession
    DisableSession
    DestroySession") --- E
    E("ThreadSampler {
      config: zx_sampler_config_t,
      current_session: SessionId,
    }")
    F@{ shape: procs, label: "PerCPUState {
      buffer: Buffer,
      event: Timer,
    }"}
    C --- F
    E --- F
    F --- G
    G(SampleThread) --- H
    H("Thread {...}")
    style E text-align:left
    style D text-align:left
    style F text-align:left