1*33de042dSApple OSS Distributions<h2>thread_sample</h2> 2*33de042dSApple OSS Distributions<hr> 3*33de042dSApple OSS Distributions<p> 4*33de042dSApple OSS Distributions<strong>Function</strong> - Perform periodic PC sampling for a thread. 5*33de042dSApple OSS Distributions<h3>SYNOPSIS</h3> 6*33de042dSApple OSS Distributions<pre> 7*33de042dSApple OSS Distributions<strong>kern_return_t thread_sample</strong> 8*33de042dSApple OSS Distributions <strong>(thread_act_t</strong> <var>sample_thread</var>, 9*33de042dSApple OSS Distributions <strong>mach_port_make_send_t</strong> <var>reply_port</var><strong>);</strong> 10*33de042dSApple OSS Distributions</pre> 11*33de042dSApple OSS Distributions<h3>PARAMETERS</h3> 12*33de042dSApple OSS Distributions<dl> 13*33de042dSApple OSS Distributions<p> 14*33de042dSApple OSS Distributions<dt> <var>sample_thread</var> 15*33de042dSApple OSS Distributions<dd> 16*33de042dSApple OSS Distributions[in thread send right] 17*33de042dSApple OSS DistributionsThread whose PC is to be sampled 18*33de042dSApple OSS Distributions<p> 19*33de042dSApple OSS Distributions<dt> <var>reply_port</var> 20*33de042dSApple OSS Distributions<dd> 21*33de042dSApple OSS Distributions[in sample receive (to be converted to send) right] 22*33de042dSApple OSS DistributionsPort to which PC 23*33de042dSApple OSS Distributionssample buffers are sent. A value of <strong>MACH_PORT_NULL</strong> stops PC 24*33de042dSApple OSS Distributionssampling for the thread. 25*33de042dSApple OSS Distributions</dl> 26*33de042dSApple OSS Distributions<h3>DESCRIPTION</h3> 27*33de042dSApple OSS Distributions<p> 28*33de042dSApple OSS DistributionsThe <strong>thread_sample</strong> function causes the program counter 29*33de042dSApple OSS Distributions(PC) of the specified 30*33de042dSApple OSS Distributions<var>sample_thread</var> to be sampled periodically (whenever the thread happens to be 31*33de042dSApple OSS Distributionsrunning at the time of the kernel's "hardclock" interrupt). 32*33de042dSApple OSS DistributionsThe set of PC sample 33*33de042dSApple OSS Distributionsvalues obtained are saved in buffers which are sent to the specified 34*33de042dSApple OSS Distributions<var>reply_port</var> in 35*33de042dSApple OSS Distributions<strong>receive_samples</strong> messages. 36*33de042dSApple OSS Distributions<h3>RETURN VALUES</h3> 37*33de042dSApple OSS Distributions<p> 38*33de042dSApple OSS DistributionsOnly generic errors apply. 39*33de042dSApple OSS Distributions<h3>RELATED INFORMATION</h3> 40*33de042dSApple OSS Distributions<p> 41*33de042dSApple OSS DistributionsFunctions: 42*33de042dSApple OSS Distributions<a href="task_sample.html"><strong>task_sample</strong></a>, 43*33de042dSApple OSS Distributions<a href="receive_samples.html"><strong>receive_samples</strong></a>. 44