class TestThreadSampler

Defined at line 34 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 36 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

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

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

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

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

sampler::ThreadSampler::ThreadSamplerLock * get_lock ()

Defined at line 44 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 46 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 52 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 58 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 168 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

bool AcquireBuffers ()

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

bool TimerReferences ()

Defined at line 259 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 291 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 302 of file ../../zircon/kernel/lib/thread_sampler/tests/thread_sampler_tests.cc

zx_status_t UnplugCpus (cpu_mask_t cpumask)

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

zx_status_t PlugCpus (cpu_mask_t cpumask)

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

bool CpuOfflining ()

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

bool CpuHotplugMultiThreaded ()

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

bool AcquireBuffersReading ()

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

bool ReadingDuringSession ()

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