task_sample.html   [plain text]

<strong>Function</strong> - Sample the target task's thread program counters periodically.
<strong>kern_return_t   task_sample</strong>
                <strong>(task_t</strong>                             <var>sample_task</var>,
                 <strong>mach_port_make_send_t</strong>               <var>reply_port</var><strong>);</strong>
<dt> <var>sample_task</var> 
[in task send right]
Port for the task whose threads' PC are to be
<dt> <var>reply_port</var> 
[in sample receive (to be converted to send) right]
Port to which PC sample buffers are sent.  A value of <strong>MACH_PORT_NULL</strong> 
stops PC sampling for the task.
The <strong>task_sample</strong> function causes the program counter (PC) of the 
specified <var>sample_task</var> (actually, all of the threads within 
<var>sample_task</var>) 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 <var>reply_port</var> in <strong>receive_samples</strong> messages.
Only generic errors apply.
<a href="thread_sample.html"><strong>thread_sample</strong></a>,
<a href="receive_samples.html"><strong>receive_samples</strong></a>.