Function - Sample the target task's thread program counters periodically.
kern_return_t task_sample (task_t sample_task, mach_port_make_send_t reply_port);
The task_sample function causes the program counter (PC) of the specified sample_task (actually, all of the threads within sample_task) to be sampled periodically (whenever one of the threads happens to be running at the time of the kernel's "hardclock" interrupt). The set of PC sample values obtained are saved in buffers which are sent to the specified reply_port in receive_samples messages.
Only generic errors apply.
Functions: thread_sample, receive_samples.