class ThreadSampler

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

Public Methods

ktl::optional<PerCpuBufferRef> GetBufferRef (cpu_num_t cpu_num)

Atomically acquire a reference to the buffer for `cpu_num` and ensure that the buffers are not

destroyed until the reference is released.

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

zx::result<size_t> ReadUser (user_out_ptr<void> ptr, uint32_t offset, size_t len)
zx::result<> SetUp (const zx_sampler_config_t & config)

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

zx::result<> Start ()

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

void ThreadSampler ()

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

void ~ThreadSampler ()

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

SamplingState State ()

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

zx::result<> Stop ()

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

zx::result<> Destroy ()

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

zx::result<sampler::ReadToken> PrepareRead ()

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

void FinishRead (sampler::ReadToken && token)

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

ktl::pair<zx_status_t, size_t> ReadUser (const sampler::ReadToken & token, user_out_ptr<void> ptr, size_t len)

ReadUser calls into VmObject::ReadUser. As we could be copying to pager backed user memory, we

must not hold any locks.

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

void ScheduleMarking ()

Atomically request the current cpu mark a thread for sampling if the session is Running.

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

void RescheduleMarking ()

Atomically rerequest the current cpu mark a thread for sampling if the session is Running.

Avoids modifying the ref count unless the session has stopped.

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

void CancelMarking ()

Atomically cancel a request that the current cpu mark a thread for sampling.

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

zx::result<> SampleThread (zx_koid_t pid, zx_koid_t tid, GeneralRegsSource source, const void * gregs, uint64_t session_id)

Given information about a thread and its registers, walk its userstack and write out a sample

if sampling is enabled.

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

Records

Friends

class TestThreadSampler