class TestThreadSampler

Defined at line 32 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

A test version of ThreadSampler which overrides functions

for testing purposes.

Despite having a test class, we use the global sampler::gThreadSampler for tests. The timer

callbacks sampling sets assume a static lifetime for the sampler.

Public Methods

fbl::Array<percpu_writer::Buffer> & get_per_cpu_buffers (sampler::ThreadSampler & sampler)

Defined at line 34 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

ktl::atomic<uint64_t> & get_state (sampler::ThreadSampler & sampler)

Defined at line 37 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

void set_state (sampler::ThreadSampler & sampler, sampler::SamplingState s)

Defined at line 38 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

sampler::ThreadSampler::ThreadSamplerLock * get_lock ()

Defined at line 42 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

uint64_t get_buffer_ref_count (const sampler::ThreadSampler & sampler)

Defined at line 44 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

uint64_t get_timer_ref_count (const sampler::ThreadSampler & sampler)

Defined at line 50 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

void SampleThread (sampler::ThreadSampler & sampler, zx_koid_t pid, zx_koid_t tid, GeneralRegsSource source, void * gregs)

Defined at line 56 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

bool RepeatStartStopTest ()

Defined at line 78 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

bool WriteSampleTest ()

Defined at line 97 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

bool StateChange ()

Defined at line 170 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

bool AcquireBuffers ()

Defined at line 208 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

bool TimerReferences ()

Defined at line 255 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

zx_status_t CheckTimerRefsIs (sampler::ThreadSampler & test_state, size_t expected)

Defined at line 287 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

zx_status_t wait_for_cpu_offline (cpu_num_t i)

Defined at line 298 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

zx_status_t UnplugCpus (cpu_mask_t cpumask)

Defined at line 315 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

zx_status_t PlugCpus (cpu_mask_t cpumask)

Defined at line 328 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

bool CpuOfflining ()

Defined at line 391 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

bool CpuHotplugMultiThreaded ()

Defined at line 483 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc