1*fdd8201dSApple OSS Distributions<h2>task_sample</h2> 2*fdd8201dSApple OSS Distributions<hr> 3*fdd8201dSApple OSS Distributions<p> 4*fdd8201dSApple OSS Distributions<strong>Function</strong> - Sample the target task's thread program counters periodically. 5*fdd8201dSApple OSS Distributions<h3>SYNOPSIS</h3> 6*fdd8201dSApple OSS Distributions<pre> 7*fdd8201dSApple OSS Distributions<strong>kern_return_t task_sample</strong> 8*fdd8201dSApple OSS Distributions <strong>(task_t</strong> <var>sample_task</var>, 9*fdd8201dSApple OSS Distributions <strong>mach_port_make_send_t</strong> <var>reply_port</var><strong>);</strong> 10*fdd8201dSApple OSS Distributions</pre> 11*fdd8201dSApple OSS Distributions<h3>PARAMETERS</h3> 12*fdd8201dSApple OSS Distributions<dl> 13*fdd8201dSApple OSS Distributions<p> 14*fdd8201dSApple OSS Distributions<dt> <var>sample_task</var> 15*fdd8201dSApple OSS Distributions<dd> 16*fdd8201dSApple OSS Distributions[in task send right] 17*fdd8201dSApple OSS DistributionsPort for the task whose threads' PC are to be 18*fdd8201dSApple OSS Distributionssampled. 19*fdd8201dSApple OSS Distributions<p> 20*fdd8201dSApple OSS Distributions<dt> <var>reply_port</var> 21*fdd8201dSApple OSS Distributions<dd> 22*fdd8201dSApple OSS Distributions[in sample receive (to be converted to send) right] 23*fdd8201dSApple OSS DistributionsPort to which PC sample buffers are sent. A value of <strong>MACH_PORT_NULL</strong> 24*fdd8201dSApple OSS Distributionsstops PC sampling for the task. 25*fdd8201dSApple OSS Distributions</dl> 26*fdd8201dSApple OSS Distributions<h3>DESCRIPTION</h3> 27*fdd8201dSApple OSS Distributions<p> 28*fdd8201dSApple OSS DistributionsThe <strong>task_sample</strong> function causes the program counter (PC) of the 29*fdd8201dSApple OSS Distributionsspecified <var>sample_task</var> (actually, all of the threads within 30*fdd8201dSApple OSS Distributions<var>sample_task</var>) to be sampled periodically (whenever one of the threads 31*fdd8201dSApple OSS Distributionshappens to be running at the time of the kernel's "hardclock" interrupt). 32*fdd8201dSApple OSS DistributionsThe set of PC sample values obtained are saved in buffers which are sent to 33*fdd8201dSApple OSS Distributionsthe specified <var>reply_port</var> in <strong>receive_samples</strong> messages. 34*fdd8201dSApple OSS Distributions<h3>RETURN VALUES</h3> 35*fdd8201dSApple OSS Distributions<p> 36*fdd8201dSApple OSS DistributionsOnly generic errors apply. 37*fdd8201dSApple OSS Distributions<h3>RELATED INFORMATION</h3> 38*fdd8201dSApple OSS Distributions<p> 39*fdd8201dSApple OSS DistributionsFunctions: 40*fdd8201dSApple OSS Distributions<a href="thread_sample.html"><strong>thread_sample</strong></a>, 41*fdd8201dSApple OSS Distributions<a href="receive_samples.html"><strong>receive_samples</strong></a>. 42